1. Chinese character to hexadecimal Unicode encoded string
<summary>
/// ////
</summary>
<param name= "character" ></param>
<returns></returns>
public string charactertocoding (string character)
{
string coding = "";
for (int i = 0; i < character. Length; i++)
{
byte[] bytes = System.Text.Encoding.Unicode.GetBytes (character. Substring (i, 1));
Remove binary encoded content
String lowcode = System.Convert.ToString (bytes[0], 16);
Remove low-byte encoded content (two-bit 16 binary)
if (lowcode.length = = 1)
{
Lowcode = "0" + lowcode;
}
String hightcode = System.Convert.ToString (bytes[1], 16);
Remove high-byte encoded content (two-bit 16 binary)
if (hightcode.length = = 1)
{
Hightcode = "0" + hightcode;
}
Coding + = (Hightcode + lowcode);
}
return coding;
}
2. Hexadecimal Unicode encoded string to Kanji
<summary>
/// //
</summary>
<param name= "Text" ></param>
<returns></returns>
public string Unicodetocharacter (string text)
{
byte[] arr = hexstringtobytearray (text);
System.Text.UnicodeEncoding converter = new System.Text.UnicodeEncoding ();
String str = converter. GetString (arr);
return str;
}
C # Implementation gets the Chinese character hexadecimal Unicode encoded string