I'm trying to use rapidjson to escape utf8 sequences to \uXXXX
format, but it's not working.
StringBuffer s;
Writer<StringBuffer, Document::EncodingType, ASCII<> > writer(s);
writer.StartObject();
writer.String("chinese");
writer.String("中文测试");
writer.EndObject();
cout << s.GetString() << endl;
The document says it would be escaped but actually it's all erased.
I tried to use AutoUTF template, but here's no document for memory stream either
Any ideas? I tried jsoncpp as well, but that library does not support unicode as well
Thanks @Milo Yip, I forget to mention I'm using Visual Studio 2010