0

Sending swedish text over the wire with XHR and my understanding is that character set encoding is forced to default UTF-8:

 Content-Type   application/json; charset=UTF-8

Upon pick the servlet request gets jumbled (i.e. swedish characters ÄÖÅ). Tried getting at the requests globally in the Weblogic container via the weblogic-application.xml by setting the webapp.encoding.default parameter to UTF-8. No difference. Want to also test locally with my Resteasy setup but the mock framework jumbled text as well. Created a PreProcessInterceptor to check the text prior to handover to the underlying service and same problem there. I could use the interceptor to force an encoding but it seems I am missing something simple (i.e. a general way to handle encoding/decoding).

Assumption is that the POST data i see in FireBug with the UTF-8 encoding looks good (no jumbling) and once it hits the service the text is jumbled so the problem is the servlet encoding?

Matthew Campbell
  • 1,864
  • 3
  • 24
  • 51
  • After checking out another post (http://stackoverflow.com/questions/1749064/how-to-find-default-charset-encoding-in-java) by adding the -Dfile.encoding (writers are just to buffer data) everything works fine in Eclipse and in the Weblogic container. – Matthew Campbell Feb 22 '11 at 13:39

1 Answers1

0

See comment. Just update the -Dfile.encoding to UTF-8 and things work fine.

Matthew Campbell
  • 1,864
  • 3
  • 24
  • 51