I have searched the web thoroughly for days now, as well as the bug database, and I am convinced this problem isn't posted anywhere. I have a website that talks to an Oracle database. The Oracle database stores most strings in UTF-8 format. Everything works fine when Tomcat is run on Win2k, XP, Mac OSX, and Solaris 8, but when I try to run the application on Linux, the UTF-8 characters display as if ISO-8859-1 is being used. I have tried the following fixes: added the charset filter that everyone speaks of to web.xml set environment variables such as JAVA_OPTS=-Dfile.encoding="UTF-8", LANG=UTF-8 and LANG=us_US.UTF-8 Even with these changes, I still get the ISO representation. Adding <%@ page contentType= "text/html;charset=UTF-8" pageEncoding= "UTF-8" %> to the JSPs forced the encoding in the HTTP headers to UTF-8 (they were by default ISO_8859-1), but the result was identical. On all the other platforms, the encoding is already UTF-8 before any of these changes. Now here is the part that really blows my mind. If I save the JSP from another server (with correct UTF-8 encoding), and put it on my server as an .html file, Tomcat serves it up perfectly. Headers are right, text displays, all is well. If I rename this to a .jsp, once again, the problem returns. For this reason I am sure it isnt the DB. Is there something in Jasper maybe that could be imposing an incorrect charset onto files in Linux? Once again, this problem only seems to exist on Linux, in both AS 2.4, as well as the newest Fedora. Thanks! John
I'm not familiar enough with the relevant code to offer a solution, but I do have a suggestion: send your query to the tomcat-user list and see if others can provide feedback. If they do, maybe we can narrow this down to a specific location in the code, and then amend this bug report to include that specific information.
Have you tried experimenting with the javaEncoding attribute of the JSPServlet (or the JspC compiler if you use that)?
Unless you can provide me with an test case that clearly demonstrates the problem, there's nothing I can do about it.