From: Ondrej T. <kon...@we...> - 2014-04-09 10:23:00
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, is there some choice, how to generate json output with right escaped unicode output like json in python. Here is my code: #include <stdio.h> #include <json/writer.h> #include <json/reader.h> #include <json/value.h> int main () { Json::FastWriter writer; Json::Reader reader; Json::Value root; const char * raw = "{\"Age\":34,\"Name\":\"Ond\\u0159ej T\\u016fma\"}"; if ( !reader.parse(raw, root)) { fprintf(stderr, "Json::Failed to parse data: %s", reader.getFormatedErrorMessages().c_str()); return 1; } printf("raw : %s\n", raw); printf("root: %s\n", writer.write(root).c_str()); return 0; } and here is my bad output: raw : {"Age":34,"Name":"Ond\u0159ej T\u016fma"} root: {"Age":34,"Name":"Ondřej Tůma"} How can i generate right output like in first line ? Thanks a lot! - -- Ondřej Tůma <mc...@ze...> www: http://ipv6.mcbig.cz jabber: mc...@ja... twitter: mcbig_cz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlNFHegACgkQBmNIPxOnb/KrPgCdHRkFw85o68RC5HLbhTtqkISt kPIAn0GZJG9NamNyv9xG7Qkt/H4NXHo8 =no8F -----END PGP SIGNATURE----- |