Hexadecimal strings into GB Chinese characters (such as "CED2C3C741" converted to "we a")

xiaoxiao2021-03-05  24

///

/// Sixteen-string strings into GB Chinese characters (such as "CED2C3C741" converted to "we A")

///

/// String to be converted

/// Translated Chinese character string

Private string HexStr2Str (String HexString)

{

System.text.encoding encode = system.text.Encoding.Getencoding ("GB2312");

Byte [] b = new byte [hexstring.length / 2];

For (int i = 0; i

{

B [i] = convert.tobyte ("0x" HexString.Substring (i * 2, 2), 16);

}

Return encode.getstring (b);

}

转载请注明原文地址:https://www.9cbs.com/read-34943.html

New Post(0)