EncodingInfo[] e = Encoding.GetEncodings(); foreach (var enc in e) { Console.WriteLine("{0}: {1}, {2}", enc.CodePage, enc.Name, enc.DisplayName); }
StreamWriter u7 = new StreamWriter(@"C:\Public\u7.txt", false, Encoding.UTF7); StreamWriter u8 = new StreamWriter(@"C:\Public\u8.txt", false, Encoding.UTF8); StreamWriter u16 = new StreamWriter(@"C:\Public\u16.txt", false, Encoding.Unicode); StreamWriter u32 = new StreamWriter(@"C:\Public\u32.txt", false, Encoding.UTF32); string hello = "Hello, World!"; u7.Write(hello); u8.Write(hello); u16.Write(hello); u32.Write(hello); u7.Close(); u8.Close(); u16.Close(); u32.Close(); // Now view each file in Notepad, and it's properties for the size