java - Character encoding of GET request parameter -
hello fellow stackoverflowers.
i have issue need with:
we're making http web service call smartphone app java/spring mvc application. we're on tomcat application server fronted apache server mod_proxy proxy setup.
one of parameters imbedded in url word "männen", organization name that's 1 of parameters. app makes jquery ajax request , parameter leaves app "m%e4nnen", understanding means "ä" has been url-encoded. when arrives spring controller, has been distorted "männen".
i have googled , found quite few threads on , recommend modifying tomcat server.xml file adding uriencoding="utf-8" connectors. of course, tried this. made change did not solve issue. string comes through "m�nnen". there thread suggesting add "nocanon" proxypass parameter in apache proxy configuration. tried made no difference.
using logs, can follow request:
- in apache access log, parameter logged "m%e4nnen"
- in apache proxy log, parameter logged "m%e4nnen"
- in tomcat localhost_access log, parameter logged "m%e4nnen"
- in spring controller receives request, parameter logged "m�nnen"
my spring application has character encoding filter, far understand, works on request body. configured shown below:
<filter> <filter-name>characterencodingfilter</filter-name> <filter-class>org.springframework.web.filter.characterencodingfilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param> <init-param> <param-name>forceencoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>characterencodingfilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> i don't know else try or else look. if guide me in right direction, highly appreciated.
if html in windows-1252 (or "subset" iso-8859-1), %e4 okay. if html in unicode, utf-8, not.
string auml = "\u00e4"; string aumlperc = urlencoder(auml, "utf-8"); urldecoder.decode(aumlperc, "utf-8"); besides html page having charset utf-8, can have <form accept-charset="utf-8" ...>.
it seems page erroneously sends %e4, accepted iso-8859-1 (the default), converted multi-byte utf-8 sequence, wrongly considered iso-8859-1.
there screws set encoding, request.setencoding, limited information cannot look. maybe information suffices.
Comments
Post a Comment