Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2005

Tip: Looking for answers? Try searching our database.

Problem with PropertyResourceBundle and unicode

Thread view: 
kiran - 14 Mar 2005 05:02 GMT
Hi,
I am trying to read some russian characters from my .properties file
(encoded in ISO-8859-1) using a PropertyResourceBundle. The russian
characters are entered in  the .properties file in unicode. My problem
is that the method call PropertyResourceBundle.getString(key) returns
valid russian charcters for some unicode charactes and square boxes for
some.
For example:
if key=\u0410\u0424\u0426, valid russian characters are returned
but if key=\u0460\u04C1\u0482, it returns square boxes.

All the above unicode characters are derived from
http://www.unicode.org/charts/PDF/U0400.pdf.

I am not sure what is special about the second string. Is it that java
has limitations on a set of characters or do I need to do anything
special to my JDK or WinXP.

Thanks in advance for the help.

-Kiran
Oscar kind - 14 Mar 2005 17:58 GMT
> I am trying to read some russian characters from my .properties file
> (encoded in ISO-8859-1) using a PropertyResourceBundle. The russian
[quoted text clipped - 5 lines]
> if key=\u0410\u0424\u0426, valid russian characters are returned
> but if key=\u0460\u04C1\u0482, it returns square boxes.

I'd say it's a problem with the font not supporting the characters. Your
handling of the non-ISO-8859-1 characters is correct, so I'd be surprised
if that's causing any problems.

[...]
> I am not sure what is special about the second string. Is it that java
> has limitations on a set of characters or do I need to do anything
> special to my JDK or WinXP.

I'm not sure of this. It could be that not all characters are mapped in
the font definitions Java uses, or the characters are missing from the
font files of XP that are referred to.

Signature

Oscar Kind                                    http://home.hccnet.nl/okind/
Software Developer                    for contact information, see website

PGP Key fingerprint:    91F3 6C72 F465 5E98 C246  61D9 2C32 8E24 097B B4E2



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.