Thursday, May 30, 2013

Re: Wrong UTF-8 string parsing in GWT JSON

Dear Philippe,

Thank you for the post,


>      String response="{ \"test\" : \"\\u00C3\\u0081\\u00C3\\u0089\\u00C5\\u00B0\" }";
> //"���" in UTF-8

No. That's not UTF-8, that's UNC encoding. It results in Java's UTF-16 encoding.

But "\u00C3\u0081" why not UTF-8 encoding?

See: http://www.utf8-chartable.de/

"Á" (LATIN CAPITAL LETTER A WITH ACUTE) hexa code is 0xC3 0x81
"\u00xx" in the JSON string is an escaped hexadecimal representation according to  RFC4627 (JSON)
See:
http://www.ietf.org/rfc/rfc4627.txt

But the character encoding is remain UTF-8, I think.

Regards,
Tibor


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment