I want to use sinhala(Sri Lanka) locale with java, I have install sinhala Unicode fonts in my pc and try it use with properties file(I have map key in English and value in sinhala) it display unknown character, when I change the value to Unicode value instead of character(like that \u0DD9) it display correctly, so Its cumbersome way, Can I use sinhala character in normal way(without using \u0DD9) ? And how can I do that?
Java's standard Properties file format only allows ASCII and Unicode escapes. However, assuming you have some way of editing a file in Sinhala using some other encoding, you can convert that file to ASCII + Unicode escapes using the native2ascii tool included in your JDK. Or, you can use Properties.loadFromXML() and storeToXML() (available in JDK 1.5+) to work with an XML-based Properties format, which allows you to use UTF-8 or other encodings.
"I'm not back." - Bill Harding, Twister
Joined: Aug 27, 2005
Thanks all for reply, I have use notepad to create my properties file, when I save there is option in notepad to select Encoding and I am select as UTF-8. This is the way I have done.
I have notice this kind of properties file (using Unicode hex-value) in apache tomcat (<tomcat_home>/common/i18n/tomcat-i18n-ja.jar file).
Please let me know why this happen and how to solve the problem?
Originally posted by Nuwan Priyadarshana: I have use notepad to create my properties file, when I save there is option in notepad to select Encoding and I am select as UTF-8. This is the way I have done.
If your properties file is in the XML format then you can use any encoding you like, although UTF-8 is almost always the best choice.
If your properties file is in the original text format, then its encoding MUST be ISO-8859-1. In this case you can put in the Unicode escapes manually (which you don't like to do) or use the "native2ascii" tool, as Jim Yingst already suggested.
Now, I know you didn't follow the link he posted, because it's broken and you didn't say anything about that. Here is the correct link. If you want to know how to solve the problem, the answer is there for you to read.
Joined: Jan 30, 2000
[Paul C]: Now, I know you didn't follow the link he posted, because it's broken and you didn't say anything about that.
I have followed the link suggested by Jim and I got a page not found error and I try this http://java.sun.com/j2se/1.5.0/docs/tooldocs/ and then click the Internationalization Tools (native2ascii) link. I have use native2ascii tool as they said but it's not solve my problem so I am still waiting for solution. I think problem may be JVM yet not support si (Sinhala locale).Please help to solve the problem.