Results 11 comments of Cao Mengfan

例如中文字符:“賊”,当addmember中存在这个字符时,获取序列化之后的json字符串中会出现多余的\\\。

~~~ #include #include "rapidjson/rapidjson.h" #include "rapidjson/document.h" #include "rapidjson/writer.h" using namespace std; using namespace rapidjson; int main() { Document d; Document::AllocatorType& allocator = d.GetAllocator(); Value root(kObjectType); root.AddMember("content", "賊", allocator); StringBuffer buffer;...

@miloyip 是的,有没有比较好的解决方式

@miloyip 我在win10,IDE是VisualStudio 2017,,输出的结果如下: 7b { 22 " 63 c 6f o 6e n 74 t 65 e 6e n 74 t 22 " 3a : 22 " d9 5c \...

使用rapidjson时后面会再加一个5c

但是c++源文件默认编码格式确实是UTF-8.

[ConsoleApplication1.zip](https://github.com/Tencent/rapidjson/files/4918202/ConsoleApplication1.zip)

@miloyip 谢谢,还是不能正常转义。我试试其它方法。

@miloyip 我找到了一种比较好的方式来解决这个问题,先将字符做GBKToUTF8处理,之后再将结果UTF8ToGBK。