How can I force ResourceBundle to read the national language characters (ö,ü,ä) properly from Servlet.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ara_Abrahamyan
Posted On:   Monday, May 7, 2001 12:11 AM

how can I force ResourceBundle to read the national language characters (ö,ü,ä) properly from Servlet, that runs on Netscape iPlanet, on Sun Solaris, without exorting the LANG variable.

Re: How can I force ResourceBundle to read the national language characters (ö,ü,ä) properly from Servlet.

Posted By:   Alistair_Sheffield  
Posted On:   Thursday, May 17, 2001 09:11 AM

Your question is a little confusing - do you mean you have a Servlet which uses ResourceBundle to read text in from a properties file, and that that properties file contains characters like those you give above?


If so, you need to convert the properties files using native2ascii, a tool provided with the JDK. Take a look at Sun's JDK tool docs for more information on it: http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html (it's in the Internationalisation section).


Basically, the problem is that java.util.Properties (the class ResourceBudle uses to load the properties file) only understands a certain format of file, where everything is in Latin 1 encoding; all non ASCII characters are converted into the following: uxxxx where xxxx gives the hex code for the character in UTF16.


Try that and let me know if it doesn't work. Or let me know if I've completely misinterpreted your question!


Alistair

About | Sitemap | Contact