Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Character Encoding

 
Michael J. Makunas
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic