可以直接把整条Unicode转成中文吗
var remote_ip_info = {"ret":1,"start":"218.192.0.0","end":"218.192.7.255","country":"\u4e2d\u56fd","province":"\u5e7f\u4e1c","city":"\u5e7f\u5dde","district":"","isp":"\u6559\u80b2\u7f51","type":"\u5b66\u6821","desc":"\u5e7f\u5dde\u5927\u5b66\u7eba\u7ec7\u670d\u88c5\u5b66\u9662\u6559\u80b2\u7f51"};
public string UnicodeDecode(string unicodeStr) { string str = unicodeStr; string outStr = ""; string[] strlist = str.Replace("\\", "").Split('u'); try { for (int i = 1; i < strlist.Length; i++) { outStr += (char)int.Parse(strlist[i], System.Globalization.NumberStyles.HexNumber); } } catch (FormatException ex) { outStr = ex.Message; } return outStr; } string rs=UnicodeDecode(@"\u5e7f\u5dde\u5927\u5b66\u7eba\u7ec7\u670d\u88c5\u5b66\u9662\u6559\u80b2\u7f51");
请叫我雷锋,不谢。
谢谢雷锋。。
你在JS里直接输出就是中文啦.
是的,我是想在后台解析出来
用个在线unicode转换就可以了。
http://tool.chinaz.com/Tools/Unicode.aspx
这个网址,粘贴进去,点unicode转中文
就转出来了:
var remote_ip_info = {"ret":1,"start":"218.192.0.0","end":"218.192.7.255","country":"中国","province":"广东","city":"广州","district":"","isp":"教育网","type":"学校","desc":"广州大学纺织服装学院教育网"};
哈哈,我是想自己转啊
谢谢,我是想在后台转