On 17/10/2016 17:59, R wrote:
> Hi,
>
> I have a default installation of Tomcat 8.5.6. When I make a POST request
> with a tilde character, and the encoding is set to UTF-8, it seems that my
> servlet handler is decoding it incorrectly.
The tilde character should not need to be encoded. The byte sequence is
also identical between UTF-8, ISO-8859-1 and ASCII.
You'll need to be more specific about exactly what URL you are passing
to Tomcat.
> I have to set the character
> encoding on the HttpServletRequest parameter to decode properly, example:
>
> protected void doPost(HttpServletRequest request, ...) {
> // I have to set this manually.
> request.setCharacterEncoding("UTF-8");
>
> // Decoding works now.
> String test = request.getParam("test");
> ...
> }
>
> Reading the Tomcat docs, it seems like everything should be UTF-8 by
> default. Is there a setting we still have to apply to get UTF-8 to be the
> default encoding?
No. Tomcat 8.5.x uses UTF-8 by default.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]