Hello,

I have some problems with cxxtools::String.

jm@jm-laptop:~/A$ file utf8_json.cpp
utf8_json.cpp: UTF-8 Unicode C program text

jm@jm-laptop:~/A$ cat utf8_json.cpp
#include <iostream>
#include <sstream>
#include <cxxtools/utf8codec.h>
#include <cxxtools/jsonserializer.h>

int main()
{
     //std::string s1("André");
     cxxtools::String s1("André");

     std::cout << s1 << std::endl;

     std::ostringstream o;
     cxxtools::JsonSerializer serializer(o);

     serializer.beautify(true);
     serializer.serialize(s1, "text");
     serializer.finish();
     std::cout << o.str() << std::endl;

     return 0;
}

jm@jm-laptop:~/A$ ./a.out
André
{
     "text": "Andr\u00c3\u00a9"
}

\u00c3 is "A tilde" and \00a9 is the copyright sign. Correct for é would 
be \u00e9.

I'm certainly make a mistake but where ?

Any ideas ?

Thanks,

Jean-Michel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to