\uxxxx This format is a Unicode notation that represents a character in which XXXX represents a 16-digit, range-0~65535. Unicode hexadecimal numbers can only contain numeric 0~9, uppercase letters A~F, or lowercase a~f. It is important to note that the size-to-end problem of Unicode, which is usually small-ended, such as \u5c0f, which represents the ' small ' word in Chinese, is converted to 10 binary is 9215, so the byte array should be 1592. Kanji to Unicode
private string Unicode2chinese (string strunicode)
{
string[] splitstring = new string[1];
Splitstring[0] = "\\u";
string[] Unicodearray = Strunicode.split (splitstring, stringsplitoptions.removeemptyentries);
StringBuilder sb = new StringBuilder ();
foreach (string item in Unicodearray)
{
byte[] codes = new byte[2];
int Code1, Code2;
Code1 = Convert.ToInt32 (item. Substring (0, 2), (+);
Code2 = Convert.ToInt32 (item. Substring (2), (+);
Codes[0] = (byte) code2;//must be small end in front
codes[1] = (byte) code1;
Sb. Append (Encoding.Unicode.GetString (codes));
}
Return SB. ToString ();
}
Unicode to Kanji
private string Chinese2unicode (String Strchinese) {string strunicodes = string.
Empty; foreach (char item in Strchinese.tochararray ()) {strunicodes + = "\\u" + ((int) item). ToString ("X");
16 binary} return strunicodes; }