Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using UNICODE

 
N Jain
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am working on a java project, which needs to incorporate
Internationalisation and Localisation. It has been suggested that the
locale specific ".properties" (errormessages_ar.properties) that
contain UNICODE equivalent of the Arabic text in my case.

My questing is why not use the Arabic text messages rather than their
UNICODE equivalent in the "xyz_ar.properties." file? What problems will
this cause?

All suggestions will be highly appreciated.

Thank you,
Nitin
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The rules for Properties files include a rule that the file must be encoded in ISO-8859-1. As the API documentation for (the Java 1.4 version of) java.util.Properties says:
When saving properties to a stream or loading them from a stream, the ISO 8859-1 character encoding is used. For characters that cannot be directly represented in this encoding, Unicode escapes are used; however, only a single 'u' character is allowed in an escape sequence. The native2ascii tool can be used to convert property files to and from other character encodings.
However if you are using Java 5 or later, you can use the XML format for properties, which doesn't have that restriction. The API documentation for java.util.Properties explains that too.
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UNICODE is the encoding (as opposed to ASCII, for example).

Arabic (as opposed to Cyrillic, for example) is a human script.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic