我在SIM900 GPRS中收到了这条短信。
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);
感谢您的提前帮助。