File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes trouble in displaying non-english (thai) characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "trouble in displaying non-english (thai) characters" Watch "trouble in displaying non-english (thai) characters" New topic

trouble in displaying non-english (thai) characters

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Hi all,

we are in a need to deal with the Thai character set (tsi-620 encoding). We need to obtain a feedback from the user in a jsp page and store the details into a text file. In other page, it displays the list of stored text files wherein each file contains the feedbacks entered. Each link to the text file should open the corresponding file in the browser and should display the contents in correct enconding (thai characters).

As such, we have 3 places to specify the encoding. One in the jsp page where we get the feedback, next in the java file where we obtain the input from jsp page and store it into the text file. Third one is the browser's setting for font encoding wherein it displays the appropriate characters.

How exactly we have to set the character encoding in these places? Till now have never had an opportunity to deal with non-english characters and hence facing some issues in that. I had been setting utf-8 and tsi-620 in these pages but none of the combinations seem to be working perfectly.

As per the googling, found out that there needs to be separate/additional display engine to display the thai characters. Will it be a cause?

Any suggestions?

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
This page explains how to set encodings in servlets and JSPs. I'm not familiar with the Thai in particular, but in general it should be sufficient to install a font that has all the required characters. That assumes that the browser knows about that particular encoding; for example, FF 3 has it in its standard list of encodings, so I'd think that it can display pages encoded that way w/o further software.

Where files are involved the correct encoding needs to be set both during writing and reading of the file.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Thank you Ulf for the link. I shall go through and get back for any further doubts.
I agree. Here's the link:
subject: trouble in displaying non-english (thai) characters
It's not a secret anymore!