Write the ASCII encoded byte arrays : Encoding ACSII « I18N Internationalization « C# / CSharp Tutorial






using System;
using System.IO;
using System.Text;

class MainClass
{
    public static void Main() 
    {        
        using (StreamWriter output = new StreamWriter("output.txt")) 
        {
            string srcString = "Area = \u03A0r^2";

            byte[] asciiString = Encoding.ASCII.GetBytes(srcString);
            output.WriteLine("ASCII  Bytes: {0}", 
                BitConverter.ToString(asciiString));
        }
    }
}








21.10.Encoding ACSII
21.10.1.Encodings: Encoding.ASCII
21.10.2.Convert the UTF-16 encoded source string to ASCII
21.10.3.Write the ASCII encoded byte arrays