Response charset in json

26 views
Skip to first unread message

Przemek

unread,
Jul 23, 2012, 7:06:02 AM7/23/12
to jsonweb...@googlegroups.com
Hi i have a small problem, maybe You can help me.

I have a request for web service in json:

Content-Type: application/json; charset=utf-8\r\n
\r\n
{"getConfigure":{ "akcja":"2", "pos":"12345","haslopos":"haslo"}}\r\n
\r\n

and I get response:
Content-Type: application/json; charset=utf-8\r\n

OR 

Content-Type: application/json; charset=windows-1250\r\n
(it depends on what tomcat I deploy *.war)

Does somebody know how to change respone charset coding ?????
I have tomcat 6.0.

Sundar Murthi

unread,
Jul 23, 2012, 7:49:27 AM7/23/12
to jsonweb...@googlegroups.com
Json codec use default encoding configured for JVM.


You may try

In the catalina.bat (catalina.sh) add the java args...

set JAVA_OPTS=-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8

then all encodings seem to come across as UTF-8 by default..
Reply all
Reply to author
Forward
0 new messages