Friday, June 1, 2012

JSON Gotcha With UTF-8

Chinese characters can get corrupted if you're not careful with transporting the JSON payload.

It's important to indicate UTF-8 to be used when reading and writing via the network.

e.g. when reading input from server:
InputStreamReader isr = new InputStreamReader(is,"utf-8");

No comments:

Post a Comment