将http调用返回json中的有关中文的unicode转换为中文

在http调用时获取到的json数据中文是乱码的解决方法:

中文转Unicode:HttpUtility.UrlEncodeUnicode(string str);
转换后中文格式:"%uxxxx"  举例:"柳_cdse53214"  转换结果是:"%u67f3_cdse53214"

Unicode转中文1:HttpUtility.UrlDecode(string str);
str格式:"%uxxxx" ,举例:"%u67f3_abc123"

Unicode转中文2:Regex.Unescape(string str);
str格式:"yhtrerwew\uxxxx" ,举例:"yhtrerwew(\uxxxx对应的中文)"

posted @ 2016-02-17 15:29  赛跑的蜗牛  阅读(1891)  评论(0编辑  收藏  举报