using System;namespace Example
{
public class Program
{
public static void Main()
{
string s = "H你";

Console.WriteLine("----------Default-----------"); for(int i = 0 ; i < s.Length; i++)
{
string str = s.Substring(i,1);

byte[] bytes = System.Text.Encoding.Default.GetBytes(str);

foreach(byte b in bytes)
{

Console.WriteLine("{0:d},{1:X}",b,b);
}
} Console.WriteLine("----------ASCII-----------"); for(int i = 0 ; i < s.Length; i++)
{
string str = s.Substring(i,1);

byte[] bytes = System.Text.Encoding.ASCII.GetBytes(str);

foreach(byte b in bytes)
{

Console.WriteLine("{0:d},{1:X}",b,b);
}
} Console.WriteLine("----------Unicode-----------"); for(int i = 0 ; i < s.Length; i++)
{
string str = s.Substring(i,1);

byte[] bytes = System.Text.Encoding.Unicode.GetBytes(str);

foreach(byte b in bytes)
{

Console.WriteLine("{0:d},{1:X}",b,b);
}
} Console.WriteLine("----------UTF7-----------"); for(int i = 0 ; i < s.Length; i++)
{
string str = s.Substring(i,1);

byte[] bytes = System.Text.Encoding.UTF7.GetBytes(str);

foreach(byte b in bytes)
{

Console.WriteLine("{0:d},{1:X}",b,b);
}
} Console.WriteLine("----------UTF8-----------"); for(int i = 0 ; i < s.Length; i++)
{
string str = s.Substring(i,1);

byte[] bytes = System.Text.Encoding.UTF8.GetBytes(str);

foreach(byte b in bytes)
{

Console.WriteLine("{0:d},{1:X}",b,b);
}
}
Console.Read();
}
}
}