Rahulg
Unregistered
|
|
Hi, With Struts I am unable to read Japanese text that is in readable format. It shows garbaled characters when I put some Japanese string in the properties file. But the japenese text in unicode format is displayed fine. it works fine with the below text: \u306b\u306a\u308a\u307e\u3059\u3002 Is it that Struts can read only the text in unnicode format and not the readable format. Could anyone please help me on this one? Thanks and regards, Rahul
|
Rahulg
Unregistered
|
|
I guess I have got the answer. Till jdk1.5 the ResourceBundle is capable of reading the the properties files onlly in unicode. Below is the excerpt from an article from sun's website: " You'll need to understand another caveat regarding property bundles; you must create them in ASCII, or use Unicode escape codes to represent Unicode characters. Since you don't compile a property file to byte codes, there is no way to tell the Java1 Virtual Machine (JVM) which character set to use. So you must explicitly stick with ASCII or use the escape sequences. You can represent a Unicode character in any Java file using \uXXXX, where XXXX is the hexidecimal representation of the character. If you don't know the hexidecimal value for a character, just use the native2ascii tool provided in the JDK. This tool will convert a file written in your native encoding to one that represents non-ASCII characters as Unicode escape sequences."
|