, , , ,

When building web applications one typically uses UTF-8 encoding thoughout to ensure that you can send and receive text in multi-byte languages such as Russian, and Chinese.

The Window 7 version of Tomcat is (insanely) not UTF-8 by default. This is because it picks up the default encoding from your installation of Java which is also not UTF-8 by default.

The appropriate Java environment variable must be set.

  • set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8"

(from stackoverflow)

This can be done by putting an appropriate setenv.bat in \Tomcat 7.0\bin or by setting the variable in the Tomcat service dialogue.