K
kiran
Hi,
I am trying to use PropertyResourceBundle to read a properties file
in my efforts to internationalize my application and display
Hebrew strings. The properties file
ApplicationResources_iw_IL.properties has an entry like
key=<string in Hebrew>
To read this file, I am creating an InputStream on this file and
creating a new PropertyResourceBundle with it as the parameter like
PropertyResourceBundle rb = new PropertyResourceBundle(inputStream);
I am retrieving the value for the key as
rb.getString(key);
The value retrieved works fine if it's in english. To test its working
in Hebrew, I installed Hebrew as one of the input locales on my windows
2000 machine, opened the properties file which is encoded as ISO-8859-1
and typed the value in hebrew using the english keyboard with the
hebrew locale. The entered value looked like Hebrew.
But the problem is that the getString() method returns a gibberish
string and not the one which looks like the one in the properties file.
I am not sure if the inputstream is not able to read the hebrew
characters properly or my setup on the US English windows machine is
wrong. Also, after entering the value in the properties file with the
Hebrew locale, I closed the file and opened it again. The hebrew text
appeared as ?????. Not sure if this
is a part of the problem.
I appreciate if you can provide me some steps in how to create the
intended properties file and then retrieve the string.
Thanks for the help
-Kiran
I am trying to use PropertyResourceBundle to read a properties file
in my efforts to internationalize my application and display
Hebrew strings. The properties file
ApplicationResources_iw_IL.properties has an entry like
key=<string in Hebrew>
To read this file, I am creating an InputStream on this file and
creating a new PropertyResourceBundle with it as the parameter like
PropertyResourceBundle rb = new PropertyResourceBundle(inputStream);
I am retrieving the value for the key as
rb.getString(key);
The value retrieved works fine if it's in english. To test its working
in Hebrew, I installed Hebrew as one of the input locales on my windows
2000 machine, opened the properties file which is encoded as ISO-8859-1
and typed the value in hebrew using the english keyboard with the
hebrew locale. The entered value looked like Hebrew.
But the problem is that the getString() method returns a gibberish
string and not the one which looks like the one in the properties file.
I am not sure if the inputstream is not able to read the hebrew
characters properly or my setup on the US English windows machine is
wrong. Also, after entering the value in the properties file with the
Hebrew locale, I closed the file and opened it again. The hebrew text
appeared as ?????. Not sure if this
is a part of the problem.
I appreciate if you can provide me some steps in how to create the
intended properties file and then retrieve the string.
Thanks for the help
-Kiran