string s = "中";
byte[] bs = Encoding.Unicode.GetBytes(s);
for(int i = 0 ; i < bs.Length ;i++)
{
Console.Write(bs[i].ToString("X"));
}
string s = "中";
Regex reg = new Regex(@"\u2d4e",RegexOptions.Compiled);
WL(reg.IsMatch(s));
string s = "中";
Regex reg = new Regex(@"\u4e2d",RegexOptions.Compiled);
WL(reg.IsMatch(s));
Encoding unicode = Encoding.Unicode;
// Get the byte order mark (BOM) of the Unicode encoder.
byte[] preamble = unicode.GetPreamble();
if(preamble[0] == 0xFE && preamble[1] == 0xFF)
{
Console.WriteLine("The Unicode encoder is encoding in big-endian order.");
}
else if(preamble[0] == 0xFF && preamble[1] == 0xFE)
{
Console.WriteLine("The Unicode encoder is encoding in little-endian order.");
}