File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Unicode and Property files Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Unicode and Property files" Watch "Unicode and Property files" New topic
Author

Unicode and Property files

Yash Sharma
Ranch Hand

Joined: Jan 30, 2003
Posts: 61
Hi,
I have an application that does not use a database and would read the Language equivalent value for English keys from Property file. Can Uncicode text (say Unicode text for various Indian languages) be stored in a Property file?
What I am worried about is that Property files perhaps cannot be saved with any encoding (while a normal text file can be saved with, say UTF8 encoding)so if I save Uncicode text in Hindi in a property file will it remain intact?
Thanks for your time.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
The API for Properties describes how this works. All Unicode chars can be saved; however if you look at the raw file data you will see that if the chars are outside the ISO-8859-1 range, they are represented using Unicode escape sequences, such as "\u03a9". Which is a little ugly to look at, but you don't have to look at the files yourself. Just use the store() and load() methods; Java will take care of everything for you, and all your Unicode characters will be properly saved and retrieved.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Unicode and Property files
 
Similar Threads
struts 2 i18n is not working, need help
Language doubt
convert uft-8 into ascii format
Linux file system with column to show file encodings?
Unicode issue(for Arabic)