aspose file tools*
The moose likes Java in General and the fly likes Sinhala Locale Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Sinhala Locale" Watch "Sinhala Locale" New topic
Author

Sinhala Locale

Nuwan Priyadarshana
Greenhorn

Joined: Aug 27, 2005
Posts: 26
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?


Nuwan<br />SCJP 1.5(83), SCWCD 1.4(86) <br/>
www.saralasolutions.com
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
Welcome to Java Ranch, Nuwan.

The problem is the editor you are using to edit the properties file. Your editor evidently does not support this encoding.

Maybe you can prove altering the file in another editors that supports it. I would like to make you a few suggestions, but it is difficult for me to prove your encoding in this moment.

My I ask what editor are you using to alter the properties file?
[ July 25, 2006: Message edited by: Edwin Dalorzo ]
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
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
Nuwan Priyadarshana
Greenhorn

Joined: Aug 27, 2005
Posts: 26
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?

Thanks
Nuwan
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18152
    
    8

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.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
[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 was... ummm... testing him. Yeah, that's it!

Thanks for the catch, Paul.
Nuwan Priyadarshana
Greenhorn

Joined: Aug 27, 2005
Posts: 26
Hi all.

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.

Thanks

Nuwan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sinhala Locale
 
Similar Threads
japanese unicode translater
Download a Font to the phone and using it?
java.awt components not able to display some non-english
Unicode char
Doubt for char in K&B