有些代碼裡和JS文件裡的消息是 \U3FF\U5IF9 等等的字符,可以將他們還原成漢字
richTextBox1是輸入文本框,richTextBox2是結果文本框
private void button1_Click(object sender, System.EventArgs e)
...{
this.richTextBox2.Text="";
String MyString = this.richTextBox1.Text;
// MyString = MyString.ToLower();
MyString = MyString.Replace("\u","\");
MyString = MyString.Replace("\U","\");
string[] value1 = MyString.Split(''\'');
string tempValue1 = "";
string tempValue2 = "";
string strOut = "";
foreach (string temp in value1)...{
if(temp.Length==0)...{
continue;
}
try...{
tempValue1 =temp;
tempValue2 = "";
if(tempValue1.Length>4)
...{
tempValue1 = temp.Substring(0,4);
tempValue2 = temp.Substring(4,temp.Length-4);
}
int intASCII = Convert.ToInt32(tempValue1, 16);
strOut += ((char)intASCII).ToString() + tempValue2;
}catch...{
strOut += temp;
}
;
}
// string dd = BB.ToString("X2");
//ok end
this.richTextBox2.Text = strOut;
}