c#:
Server.UrlDecode("\u9646\u660e\u534e")
javascript:
decodeURIComponent("\u9646\u660e\u534e")
--------------------------------------
<script type="text/javascript">
var c = "window.a='\u9646\u660e\u534e'";
eval(c);
alert(a);
alert(decodeURIComponent("\u9646\u660e\u534e"))
</script>
-------------------------
- -#, 最近做什么都晕乎乎的。。。看WC3L去。。
/// <summary>
/// t.txt : \u9646\u660e\u534e
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e) {
string a = System.IO.File.ReadAllText(@"c:\t.txt").Trim();
MessageBox.Show(UnicodeToString(a));
}
private string UnicodeToString(string inputs) {
StringBuilder sb = new StringBuilder();
int len = inputs.Length / 6;
for (int i = 0; i <= len - 1; i++) {
string strT = "";
strT = inputs.Substring(0, 6).Substring(2);
inputs = inputs.Substring(6);
sb.Append(Convert.ToChar(int.Parse(strT, NumberStyles.HexNumber)));
}
return sb.ToString();
}
你用什么编码就用什么解码!