I am invoking a Servlet which is running in a Websphere 6.1 using the following encoded UTF-8 URL:
http://mydomain.com/testingUtf?first=%E3%81%82
Then when I get the request parameter using
req.getParameter(“first”);
from my servlet the value is: ã instead of あ.
What am I missing? Why am I getting that character?
It appears as if Websphere is applying an invalid character encoding to the query parameter.
When I do the same test with Jetty it work as expected.
in your HTTP request, add the “Content-Type” header. Set it to the proper MIME value (text/xml, text/plain, etc), then specify the encoding, like so:
application/x-www-form-urlencoded; charset=UTF-8
WebSphere 7 properly parses our UTF-8 encoded parameters using this. Should probably work for 6.1 too.