我在 SIM900 GPRS 的 SMS 中收到此消息。
07916698019021F00410D05479BDDC7CBBCB790008217002123430826A0049006E0063006F00720072006500630074002000700061007300730077006F00720064002E00200050006C050610306500065060740507202079060750702007001070730700F0700402001060010600E02
另一个示例消息:
07916698019021F00410D05479BDDC7CBBCB790008217002025501826A0049006E0063006F00720072006500630074002000700061007300730077006F00720064002E00200050006C06001073050200506E04065070200906F07072020700607307007060020600006007060090600E
我认为这条消息是 Unicode UCS-2 格式并且是泰语。但是我无法将其转换为可读的东西。我发现这个非常有用的代码:
//Here's how you'd go from a string to stuff like
// U+0053 U+0063 U+006f
string scott = "ฉ";
foreach (char s in scott) {
Console.Write("{0:x4} ", (int)s);
}
//Here's how converted a string (assuming it starts with U+)
// containing the representation of a char
// back to a char
// Is there a built in, or cleaner way? Would this work in Chinese?
string maybeC = "U+0063";
int p = int.Parse(maybeC.Substring(2),
System.Globalization.NumberStyles.HexNumber);
Console.WriteLine((char)p);
提前致谢。