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 cha开发者_如何学Goracters ÄÖÅ). 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?
See comment. Just update the -Dfile.encoding to UTF-8 and things work fine.
精彩评论