简体   繁体   English

JSON编码和解码#2

[英]JSON encoding and decoding #2

I have been working with JSON REST service for Elastic Search a lot lately. 最近,我一直在为Elastic Search使用JSON REST服务。 The most common problem I have come across is the encoding and coding of the HTML in the JSON. 我遇到的最常见问题是JSON中HTML的编码和编码。

At this point I have tried a combination of htmlencode and htmldecode but some of the characters come out as funny. 在这一点上,我尝试了htmlencodehtmldecode的组合,但是其中一些字符htmldecode很有趣。

What is the best way of handling this HTML? 处理此HTML的最佳方法是什么?

I used JSON.NET for encoding and decoding and it seems to work without any problems. 我使用JSON.NET进行编码和解码,它似乎可以正常工作。 I would highly recommend this for anybody looking to work with JSON. 我强烈建议任何希望使用JSON的人使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM