• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sinhala Locale

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Nuwan Priyadarshana
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[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
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic