my dog learned polymorphism*
The moose likes Tomcat and the fly likes Character Encoding 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 "Character Encoding" Watch "Character Encoding" New topic
Author

Character Encoding

Michael J. Makunas
Ranch Hand

Joined: Mar 11, 2002
Posts: 37
Not sure if this is the correct forum for this but....

I have an Apache/Tomcat/MySql site that has mix of English and Turkish content. When someone views the site, some of the Turkish characters are not displaying properly. I tried adding the following to all pages:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

But for some reason browsers are auto-detecting the site as "Western" or "ISO-8859-1" even though when I go to other sites that suport the Turkish character set and that also use the same meta tag (e.g., http://www.google.com/intl/tr/) they are auto-detected as "Unicode" or "UTF-8". Is there a way to set the character encoding at the http server or app server level?
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Is there a way to set the character encoding at the http server or app server level?


In my opinion,

I have 2 solution to solve this problem.

1. Set charset inpage directive of JSP page.
Example



2. Use Sevlet Filter for Encoding in each request.

Reference Website
Unicode development with DbForms, MySQL 4.1, and friends

Multibyte-character processing in J2EE

End-to-end internationalization of Web applications


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Character Encoding
 
Similar Threads
Displaying Japanese characters in JSP
Auto-dectect character encoding in JSP
How to force encoding of web browser to UTF-8
reading foreign characters (say, multi-byte charcters, Japanese, Turkish, etc) from a file in java.
Character set encoding issue