string s ="中"; Regex reg =new Regex(@"\u4e2d",RegexOptions.Compiled); WL(reg.IsMatch(s));
此时,返回的是希望看到的True。
后来通过查看
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) }