golang 如何解析含有转义字符的字符串,为标准格式的json字符

markcheney · · 3205 次点击 · 开始浏览    置顶
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。

``` 获取到是[]byte数据,我通过string([]byte数据)转化为string后是带有转义的json字符串, 我改如何将里面的Unicode输出为中文,转化为标准的json字符串???搞了一个晚上了,完全没有头绪 如下: ``` ``` {"msg":"\u8be5\u5355\u53f7\u6682\u65e0\u7269\u6d41\u8fdb\u5c55\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\uff0c\u6216\u68c0\u67e5\u516c\u53f8\u548c\u5355\u53f7\u662f\u5426\u6709\u8bef\u3002","status":"-3","error_code":"13","data":{"info":{"status":"0","msg":"\u8be5\u5355\u53f7\u6682\u65e0\u7269\u6d41\u8fdb\u5c55\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\uff0c\u6216\u68c0\u67e5\u516c\u53f8\u548c\u5355\u53f7\u662f\u5426\u6709\u8bef\u3002","_source_com":""},"com":"zhongtong","company":{"url":"http:\/\/www.zto.com\/?from=openv","fullname":"\u4e2d\u901a\u5feb\u9012","shortname":"\u4e2d\u901a","icon":{"id":"29","smallurl":"https:\/\/ss0.baidu.com\/6ONWsjip0QIZ8tyhnq\/it\/u=3682653099,2524883494&fm=58","smallpos":"0,496","middleurl":"https:\/\/ss2.baidu.com\/6ONYsjip0QIZ8tyhnq\/it\/u=1078213688,3146076104&fm=58","middlepos":"0,324","normal":"https:\/\/ss0.baidu.com\/6ONWsjip0QIZ8tyhnq\/it\/u=1022514261,1855787563&fm=58"},"website":{"title":"www.zto.com","url":"http:\/\/www.zto.com"},"tel":"95311","auxiliary":[{"title":"\u7f51\u70b9\u67e5\u8be2","url":"http:\/\/www.zto.com\/GuestService\/SiteQuery"},{"title":"\u7f51\u4e0a\u5bc4\u4ef6","url":"http:\/\/my.zto.com\/order"},{"title":"\u4ef7\u683c\u67e5\u8be2","url":"http:\/\/www.zto.com\/GuestService\/PriceQuery"},{"title":"\u4e2d\u901a\u4f18\u9009","url":"http:\/\/www.ztbest.com"}]},"source":{"logo":"https:\/\/ss2.baidu.com\/6ONYsjip0QIZ8tyhnq\/it\/u=1429564979,1787167512&fm=58","title":"\u6570\u636e\u6765\u81ea\u5feb\u9012100","url":"http:\/\/www.kuaidi100.com\/?from=baidu_ala","name":"\u5feb\u9012100","showName":"\u5feb\u9012100"}}} ```

有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:701969077

3205 次点击  
加入收藏 微博
5 回复  |  直到 2018-02-01 09:36:09
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传