Newtonsoft.Json解决中文编码
默认Newtonsoft.Json序列化对象后,返回的中文未进行编码。
需要将编码转换的话,需要
1
2
3
4
5
6
7
|
var json = JsonConvert.SerializeObject( new { uid = resultUser[ "uid" ], usersign = resultUser[ "usersign" ], price = price }, new JsonSerializerSettings() { StringEscapeHandling = StringEscapeHandling.EscapeNonAscii }); |
其中: StringEscapeHandling = StringEscapeHandling.EscapeNonAscii 为关键代码
转自:http://Www.CnBlogs.Com/WebEnh/
如果想下次快速找到我,记得点下面的关注哦!
本博客Android APP 下载 |
支持我们就给我们点打赏 |
支付宝打赏 支付宝扫一扫二维码 |
微信打赏 微信扫一扫二维码 |
如果想下次快速找到我,记得点下面的关注哦!