• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Unicode and Property files

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic