Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internationlization using struts 1

Status
Not open for further replies.

Pro79

Programmer
Dec 11, 2003
24
IN
Hi
i am using property resource bundle to hold the data but getting problem when i am taking japanese characters. characterset of my jsp is UTF-8. If i use france charset properties file it is coming accordingly
can any one suggest me any solution
thanx and regards
 
Java only support properties file in ascii format. In order for Java to read properties file with characters in other encoding, you will need to use a java tool "native2ascii" to covert yor properties in UTF-8 encoding into ascii format. native2ascii comes with JDK. it is in JAVA_HOME/bin directory.

let say your UTF-8 propeties file is named as resource-UTF8_ja.properties, then you can run the tool as:

native2ascii -encoding UTF-8 resource-UTF8_ja.properties resource_ja.properties

give struts to use the coverted propeties resource_ja.properties. It should then solve your problem

more details can be found at
 
the above is working fine
but one problem i am getting is
my properties file is in ansi format when i save as it utf-8 and then use nativetoascii tool to convert it into utf-8 it is working fine for japanese characters but if i saveas it as unicode and then use utility native2ascii to convert it into utf-8 then it is not working

do u have any suggestion
Thank you
 
Java can only read properties in ASCII format. After you enter and save your properties in UTF-8 format, you then use native2ascii to covert that into ASCII. the coverted ASCII file will be the resource file read by Java.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top