Le 19/03/2012 07:00, Jean-Michel Caricand a écrit :
> Hello,
>
> I have a question : is it possible to serialize utf-8 string with
> jsonserializer ?
> When I try, the é, à (I'm french) are not correctly processed.
>
> Any ideas ?
>
> Jean-Michel
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Tntnet-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tntnet-general
Hello,

A little test :)

$ cat jsonserializer.cpp
#include <iostream>
#include <sstream>
#include <cxxtools/jsonserializer.h>

using namespace std;
using namespace cxxtools;

int main(int argc, char *argv[])
{
     string s1 = "Anaïs";
     ostringstream o;

     JsonSerializer serializer(o);
     //serializer.beautify(true);
     serializer.serialize(s1, "s1");
     serializer.finish();

     cout << "s1: " << s1 << endl;
     cout << "json : " << o.str() << endl;

     return 0;
}
jm@jm-laptop:~$

$ ./jsonserializer
s1: Anaïs
json : {"s1":"Anaïs"}
$

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to