You can try forcing the JVM to start with UTF 8 using a JVM parameter.
-Dfile.encoding=UTF-8
Where you put it depends on how you start tomcat, I think JAVA_OPTS will do it.

This is quick and may work. You can also try to force the servlet
output stream to be in the encoding that you want from your code
before you do any writing. If you are writing the text from a servlet,
its a function of the response. If you are doing it in JSP, it is a
parameter of the JSP page.
<%...@page pageEncoding="UTF-8"%>
You must define the encoding on the output stream before you start writing.

We have a warning in one of our startup classes, so we know about
those problems when they happen (in this case its in filter init, can
be pretty much anywhere)

String defaultCharset = Charset.defaultCharset().name();
if (!defaultCharset.substring(0, 3).equalsIgnoreCase("utf")) {
        // not UTF!
        logger.warn("JVM Character encoding is not UTF, it is '" +
defaultCharset + "'");
}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to