• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic