This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes UTF-8 and Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "UTF-8 and Tomcat" Watch "UTF-8 and Tomcat" New topic
Author

UTF-8 and Tomcat

Bill Wied
Greenhorn

Joined: Mar 11, 2009
Posts: 9
I have been working on internationalizing my website.

I am able to get it to work it work by pulling the UTF-8 formatted properties from a resource bundle. The problem is that I need to manually change the browsers encoding from ISO8859-1 to UTF-8. It then displays the Japanese characters corretly.

When I add the following line to the begining of my JSP it then correctly sends the content-type of UTF-8 and the browser recognizes the file as UTF-8.

<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>

However, the data then comes out garabled (i.e. probably unencoded).

I am using Tomcat 5.5 and the JSPs are stored as UTF-8 files.

Any help would be appreciated.

Thanks,
Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: UTF-8 and Tomcat
 
Similar Threads
Encoding in Java file
request.setCharactereEncoding doesn't work on Tomcat ?
Internationlizing JSPs
How to set Multilanguage Subject in Javax.mail
ByteArrayOutputStream to String