JSP set content type problem!!!
Posted on 2007-11-19
I have a JSP page which reads hex data from Oracle database. I wrote data in Hex because I don't want to suffer Arabic/Persian language problem in Oracle database.
Then I output data with dehexing them into User's browser in runtime in JSP.
HERE IS MAIN PROBLEM:
I tried to set Content-Type to UTF8 with HTML code like this:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
I tried to set it to UTF8 with JSP:
<% response.setContentType("text/html; charset=UTF-8");%>
It changes Content Type to UTF8, but not real and good UTF8! Because I cannot see right text.
But when I do not add anything and any changing to charset by any HTML or JSP, and I open page I see strange chars, then I change it to UTF8 manually and it works!!!!! WHY?