This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes Using UNICODE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using UNICODE" Watch "Using UNICODE" New topic
Author

Using UNICODE

N Jain
Greenhorn

Joined: Aug 11, 2007
Posts: 14
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
Bartender

Joined: Oct 14, 2005
Posts: 18715
    
    8

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

Joined: Nov 08, 2007
Posts: 457
UNICODE is the encoding (as opposed to ASCII, for example).

Arabic (as opposed to Cyrillic, for example) is a human script.


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using UNICODE