I'm trying to allow multilingual support in my app which makes an HTTP post to upload new messages. What do I need to do in order to support japanese & other non latin based languages? my code currently looks something like this:
//note the msg string is a JSON message by the time it gets here...
private String doHttpPost(String url, String msg)
throws Exception {
HttpPost post = new HttpPost(url);
StringEntity stringEntity = new StringEntity(msg);
post.setEntity(stringEntity);
return execute(post);
}
Try setting encoding on StringEntity:
StringEntity stringEntity = new StringEntity(msg, "UTF-8");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With