I am facing the same issue in tomcat & jsp as listed in below asp issue Classic ASP gremlims, getting a  inserted into text whenever an HTML special character is used
Using tomcat 5 and jsp. When I type in a string containing like ±20°C and submit to another JSP the resultant parameter after submit is ±20°C. An addition character 'Â' is being added before every special char in the request itself. How do I resolve this issue?
Thanks,
This is caused by displaying UTF-8 page as Latin-1. For example, ± is encoded as 0xB1 in Latin-1 but 0xC2, 0xB1 in UTF-8. 0xC2 happens to be Â.
This is kind of strange for a JSP page. Normally, JSP will use the same encoding in the writer and "Content-Type" header so you always get the same encoding. Check if you specifies encoding like this,
<%@page pageEncoding="UTF-8" %>
If you have a custom "Content-Type" header, make sure you append ", charset=UTF-8".
That is the symptom of ISO-Latin-whatever source data being transcoded into UTF-8 on the way out. Check your character encodings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With