I really don't know about TX. the user name encoding actually returns different values. For example, "Lei 52D", there are two types of returned values? Lei? 52D and % 01% u96F7 % u78CA % 0152D. Quite depressing. Fortunately, there is still a Chinese name returned for TX, which saves the process of decoding, but records it.
Copy codeThe Code is as follows:
/// <Summary>
/// Convert Unicode characters to Chinese characters, such as 96F7 and 78CA"
/// </Summary>
Private char UnicodeToChineseByHex (string Unicode)
{
Return (char) int. Parse (Unicode, System. Globalization. NumberStyles. HexNumber );
}
/// <Summary>
/// Convert Unicode characters to Chinese characters, such as 96F7 and 78CA
/// Note: decode the forward
/// </Summary>
Private string UnicodeToChinese (string Unicode)
{
Byte [] array = new byte [Unicode. Length/2];
For (int I = 0; I <array. Length; I ++)
{
String s1 = Unicode. Substring (Unicode. Length-(I + 1) * 2, 2 );
Int t1 = Convert. ToInt32 (s1, 16 );
Array [I] = (byte) t1;
}
Return System. Text. Encoding. Unicode. GetString (array );
}
/// <Summary>
/// Convert Chinese characters to Unicode characters, such as 'Re'
/// </Summary>
Private string ChineseToUnicode (char Chinese)
{
Return (int) Chinese). ToString ("x ");
}