GeeCON Prague 2014*
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
Author

trouble in displaying non-english (thai) characters

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

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
Marshal

Joined: Mar 22, 2005
Posts: 42061
    
  64
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.


Ping & DNS - my free Android networking tools app
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Thank you Ulf for the link. I shall go through and get back for any further doubts.
 
 
subject: trouble in displaying non-english (thai) characters