Tuesday, March 20, 2007

Encoding problem with tomcat

Recently I had problem with encoding. Now I'm going to describe it. I created simple html template which used russian (or ukrainian) letters. Saved this template in UTF-8 encoding. When I view this template file in firefox or IE everything was written good. But when I wrapped it into war and put it into tomcat/webapp directory and tried to view it like localhost:8080/domain/site, I could not read a word. Firefox or IE also showed that current encoding is UTF-8. Changing of all encodings didn't help. The solution for current problem was to add option to JAVA_OPTS in catalina.bat (or catalina.sh in Linux) like -Dfile.encoding=UTF-8.

No comments: