FranzGames / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

why gson give up use utf16 #438

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
our old program(c++) only support utf 16.
and for gson 1.2 it works. 
but now ... 
so how can i use both gson2.1 and utf 16 encoding

Expect : 
        JsonRPC j = new JsonRPC();
        j.setJsonrpc("发额发发的");
        Gson gson = new Gson();
        System.out.println(gson.toJson(j));

        {"id":0,"jsonrpc":"\u53d1\u989d\u53d1\u53d1\u7684"}

Thanks...

Original issue reported on code.google.com by jion...@gmail.com on 24 Apr 2012 at 1:08

GoogleCodeExporter commented 9 years ago
Gson relies on the Java libraries to do character decoding. You probably want 
to look for InputStreamReader.

Original comment by limpbizkit on 30 Jun 2012 at 3:23