Philippe Verdy
2005-01-05 09:36:19 UTC
- If you have setup your Hindi resource bunde file,
- and saved it in Unidode UTF-8 plain-text format,
- and named it accordingly as: MessagesBundle_hi.UTF-8.txt
- and converted it to ISO-8859-1 using the appropriate Java SDK tool:
native2ascii -encoding UTF-8
< MessagesBundle_hi.UTF-8.txt
like "\u0915" which stands for the Unicode character U+0915 (Devanagari letter Ka)
- and then inserted or replaced the "MessagesBundle_hi.properties" file into your installed "MessagesBundles.jar" file
within the Limewire installation directory using some ZIP tool or using the following java tool:
jar -uf MessagesBundle_hi.properties MessagesBundle_hi.properties
- and you have installed the *international* version of the Java runtime (which includes support for larger subset of Unicode and
the support for Devanagari rendering
- and your system is configured with Devanagari fonts
Then this should work. If you still see square boxes, it's because either:
- the source file is not properly encoded with Unicode (may be ISCII, or Windows Hindi)
- the conversion to ISO-8859-1 with unicode escapes is incorrect
(follow the tips above to convert from UTF-8)
- your installation of Java is not international: go www.sun.com/getjava
(you need the version that installs the "charsets.jar" support file in %javahome%/lib)
- you have several versions of Java installed, and the default one is not international
(check the Java control panel to select the appropriate one; if this does not work, reinstall Java)
- your system doesnot have the appropriate fonts to display Devanagari:
* with the Java 1.5 installation, there's a file named "font.properties" in %javahome%\lib
which includes this line for Windows:
allfonts.devanagari=Mangal
and says that the font to select for the devanagari script is "Mangal".
* Windows must be installed with the rendering support for "complex scripts"
* the referenced font "Mangal" above should be installed when you have selected support for Indian scripts
* with Java 1.4, Devanagari will only be displayed by default if your *system* locale is also working with Devanagari.
(the user locale is not enough, because of the way the font loader works in Java 1.4 or below, which allows
to display by default only scripts in the same family plus basic Latin).
Note however Java 1.4 can be setup to support Devanagari in addition to the default fonts detected for the system locale.
There's an example within our repository, with the "windows.font.properties" which can be used instead of the default "font.properties" stored in %javahome%\lib. It contains the following additional section:
---- [start quote: cut below this line] ----
# 16. DEFAULT_CHARSET (Hindi: Devanagari)
filename.Mangal=MANGAL.TTC
dialog.plain.16=Mangal,DEFAULT_CHARSET
dialog.bold.16=Mangal,DEFAULT_CHARSET
dialog.italic.16=Mangal,DEFAULT_CHARSET
dialog.bolditalic.16=Mangal,DEFAULT_CHARSET
fontcharset.dialog.16=sun.io.CharToByteUnicodeLittle
#exclusion.dialog.16=
sansserif.plain.16=Mangal,DEFAULT_CHARSET
sansserif.bold.16=Mangal,DEFAULT_CHARSET
sansserif.italic.16=Mangal,DEFAULT_CHARSET
sansserif.bolditalic.16=Mangal,DEFAULT_CHARSET
fontcharset.sansserif.16=sun.io.CharToByteUnicodeLittle
#exclusion.sansserif.16=
dialoginput.plain.16=Mangal,DEFAULT_CHARSET
dialoginput.bold.16=Mangal,DEFAULT_CHARSET
dialoginput.italic.16=Mangal,DEFAULT_CHARSET
dialoginput.bolditalic.16=Mangal,DEFAULT_CHARSET
fontcharset.dialoginput.16=sun.io.CharToByteUnicodeLittle
#exclusion.dialoginput.16=
monospaced.plain.16=Mangal,DEFAULT_CHARSET
monospaced.bold.16=Mangal,DEFAULT_CHARSET
monospaced.italic.16=Mangal,DEFAULT_CHARSET
monospaced.bolditalic.16=Mangal,DEFAULT_CHARSET
fontcharset.monospaced.16=sun.io.CharToByteUnicodeLittle
#exclusion.monospaced.16=
serif.plain.16=Mangal,DEFAULT_CHARSET
serif.bold.16=David Bold,DEFAULT_CHARSET
serif.italic.16=Mangal,DEFAULT_CHARSET
serif.bolditalic.16=David Bold,DEFAULT_CHARSET
fontcharset.serif.16=sun.io.CharToByteUnicodeLittle
#exclusion.serif.16=
---- [end quote: cut above this line] ---
Normally this change in "font.properties" (for Java 1.4 or below) is not needed for native systems setup with Devanagari. It is not needed for Java 1.5 whose font configuration and support is much simpler.
If you have other difficulties, please specify:
- your operating system (if Windows, specify which version: 95/98/ME/SE/2000/XP/2003),
- its native (retail) localization: is it an Indian version?
- your version of Java: run "java -version" from the command line
You could also check with the existing Hindi file in our CVS repository: the translation is very basic and mostly not done, but you should be able to see a few strings. With the developer version of Limewire (compiled from the CVS sources) you should see, in the "View/Change Language" menu the Devanagari-written name of the "Hindi (India)" language i.e. you should see " à€¹à€¿à€à€Šà¥ (à€à€à€¡à€¿à€¯à€Ÿ) ". And at run, you should see the OK button translated as " à€ à¥à€ " for example in the options dialog box (and its tooltip displayed as " à€à¥à€°à€¿à€¯à€Ÿ à€²à€Ÿà€à¥ à€à€°à¥à€.", which means "apply operation.")
Note: on Windows, the Indian scripts are supported by installing any of the following codepages in the regional settings of the Control Panel (the support of Unicode in regional settings is not enough, because it is just a framework for Unicode processing, enabled by default and needed for all other scripts and languages):
- 57002: ISCII devanagari
- 57003: ISCII bengali
- 57004: ISCII tamil
- 57005: ISCII telugu
- 57006: ISCII assamese
- 57007: ISCII oriya
- 57008: ISCII kannada
- 57009: ISCII malalayam
- 57010: ISCII gujarati
- 57011: ISCII pendjabi (gurmukhi)
Selecting any one of them will only be possible if the extensions for complex Asian scripts is first installed in the regional settings. If these codepages are selected and installed, the needed core fonts for displaying them will also be installed. For Devanagari, the Windows installer will load and install the "Mangal" font, and will allow you to install a Devanagari keyboard map generating Devanagari sequences. Note however that the "Windows ANSI" codepage used will be one of the above, but Java requires an Unicode encoding for its strings.
We use UTF-8 as a "lingua franca" encoding for all *source* property files that can't be written using only the ISO-8859-1 (Western European Latin 1) subset. However UTF-8 files are not directly usable as regular .properties files, which can only store in a WYSIWYG way the Latin-1 characters (others need to be "escaped").
----- Original Message -----
From: Anil N. Juthani
To: ***@lists.limewire.org
Sent: Tuesday, January 04, 2005 5:12 PM
Subject: [trans] Hi Sanjeev.... - Java query.
Hi Sanjeev,
I came across ur reference on the internet. I am having some problems in using Hindi for my Java application. I have selected indic in the regional settings option for Win2000 professional and have generated the right resource bundle files. However, my application always shows up 'rectangles' instead of hindi characters....
Any idea as to what would be wrong in my settings. Help would be greatly appreciated.
Thanks,
----Anil
- and saved it in Unidode UTF-8 plain-text format,
- and named it accordingly as: MessagesBundle_hi.UTF-8.txt
- and converted it to ISO-8859-1 using the appropriate Java SDK tool:
native2ascii -encoding UTF-8
< MessagesBundle_hi.UTF-8.txt
MessagesBundle_hi.properties
so that non ISO-8859-1 (Latin) characters will be converted to hexadecimal "Unicode escape sequences"like "\u0915" which stands for the Unicode character U+0915 (Devanagari letter Ka)
- and then inserted or replaced the "MessagesBundle_hi.properties" file into your installed "MessagesBundles.jar" file
within the Limewire installation directory using some ZIP tool or using the following java tool:
jar -uf MessagesBundle_hi.properties MessagesBundle_hi.properties
- and you have installed the *international* version of the Java runtime (which includes support for larger subset of Unicode and
the support for Devanagari rendering
- and your system is configured with Devanagari fonts
Then this should work. If you still see square boxes, it's because either:
- the source file is not properly encoded with Unicode (may be ISCII, or Windows Hindi)
- the conversion to ISO-8859-1 with unicode escapes is incorrect
(follow the tips above to convert from UTF-8)
- your installation of Java is not international: go www.sun.com/getjava
(you need the version that installs the "charsets.jar" support file in %javahome%/lib)
- you have several versions of Java installed, and the default one is not international
(check the Java control panel to select the appropriate one; if this does not work, reinstall Java)
- your system doesnot have the appropriate fonts to display Devanagari:
* with the Java 1.5 installation, there's a file named "font.properties" in %javahome%\lib
which includes this line for Windows:
allfonts.devanagari=Mangal
and says that the font to select for the devanagari script is "Mangal".
* Windows must be installed with the rendering support for "complex scripts"
* the referenced font "Mangal" above should be installed when you have selected support for Indian scripts
* with Java 1.4, Devanagari will only be displayed by default if your *system* locale is also working with Devanagari.
(the user locale is not enough, because of the way the font loader works in Java 1.4 or below, which allows
to display by default only scripts in the same family plus basic Latin).
Note however Java 1.4 can be setup to support Devanagari in addition to the default fonts detected for the system locale.
There's an example within our repository, with the "windows.font.properties" which can be used instead of the default "font.properties" stored in %javahome%\lib. It contains the following additional section:
---- [start quote: cut below this line] ----
# 16. DEFAULT_CHARSET (Hindi: Devanagari)
filename.Mangal=MANGAL.TTC
dialog.plain.16=Mangal,DEFAULT_CHARSET
dialog.bold.16=Mangal,DEFAULT_CHARSET
dialog.italic.16=Mangal,DEFAULT_CHARSET
dialog.bolditalic.16=Mangal,DEFAULT_CHARSET
fontcharset.dialog.16=sun.io.CharToByteUnicodeLittle
#exclusion.dialog.16=
sansserif.plain.16=Mangal,DEFAULT_CHARSET
sansserif.bold.16=Mangal,DEFAULT_CHARSET
sansserif.italic.16=Mangal,DEFAULT_CHARSET
sansserif.bolditalic.16=Mangal,DEFAULT_CHARSET
fontcharset.sansserif.16=sun.io.CharToByteUnicodeLittle
#exclusion.sansserif.16=
dialoginput.plain.16=Mangal,DEFAULT_CHARSET
dialoginput.bold.16=Mangal,DEFAULT_CHARSET
dialoginput.italic.16=Mangal,DEFAULT_CHARSET
dialoginput.bolditalic.16=Mangal,DEFAULT_CHARSET
fontcharset.dialoginput.16=sun.io.CharToByteUnicodeLittle
#exclusion.dialoginput.16=
monospaced.plain.16=Mangal,DEFAULT_CHARSET
monospaced.bold.16=Mangal,DEFAULT_CHARSET
monospaced.italic.16=Mangal,DEFAULT_CHARSET
monospaced.bolditalic.16=Mangal,DEFAULT_CHARSET
fontcharset.monospaced.16=sun.io.CharToByteUnicodeLittle
#exclusion.monospaced.16=
serif.plain.16=Mangal,DEFAULT_CHARSET
serif.bold.16=David Bold,DEFAULT_CHARSET
serif.italic.16=Mangal,DEFAULT_CHARSET
serif.bolditalic.16=David Bold,DEFAULT_CHARSET
fontcharset.serif.16=sun.io.CharToByteUnicodeLittle
#exclusion.serif.16=
---- [end quote: cut above this line] ---
Normally this change in "font.properties" (for Java 1.4 or below) is not needed for native systems setup with Devanagari. It is not needed for Java 1.5 whose font configuration and support is much simpler.
If you have other difficulties, please specify:
- your operating system (if Windows, specify which version: 95/98/ME/SE/2000/XP/2003),
- its native (retail) localization: is it an Indian version?
- your version of Java: run "java -version" from the command line
You could also check with the existing Hindi file in our CVS repository: the translation is very basic and mostly not done, but you should be able to see a few strings. With the developer version of Limewire (compiled from the CVS sources) you should see, in the "View/Change Language" menu the Devanagari-written name of the "Hindi (India)" language i.e. you should see " à€¹à€¿à€à€Šà¥ (à€à€à€¡à€¿à€¯à€Ÿ) ". And at run, you should see the OK button translated as " à€ à¥à€ " for example in the options dialog box (and its tooltip displayed as " à€à¥à€°à€¿à€¯à€Ÿ à€²à€Ÿà€à¥ à€à€°à¥à€.", which means "apply operation.")
Note: on Windows, the Indian scripts are supported by installing any of the following codepages in the regional settings of the Control Panel (the support of Unicode in regional settings is not enough, because it is just a framework for Unicode processing, enabled by default and needed for all other scripts and languages):
- 57002: ISCII devanagari
- 57003: ISCII bengali
- 57004: ISCII tamil
- 57005: ISCII telugu
- 57006: ISCII assamese
- 57007: ISCII oriya
- 57008: ISCII kannada
- 57009: ISCII malalayam
- 57010: ISCII gujarati
- 57011: ISCII pendjabi (gurmukhi)
Selecting any one of them will only be possible if the extensions for complex Asian scripts is first installed in the regional settings. If these codepages are selected and installed, the needed core fonts for displaying them will also be installed. For Devanagari, the Windows installer will load and install the "Mangal" font, and will allow you to install a Devanagari keyboard map generating Devanagari sequences. Note however that the "Windows ANSI" codepage used will be one of the above, but Java requires an Unicode encoding for its strings.
We use UTF-8 as a "lingua franca" encoding for all *source* property files that can't be written using only the ISO-8859-1 (Western European Latin 1) subset. However UTF-8 files are not directly usable as regular .properties files, which can only store in a WYSIWYG way the Latin-1 characters (others need to be "escaped").
----- Original Message -----
From: Anil N. Juthani
To: ***@lists.limewire.org
Sent: Tuesday, January 04, 2005 5:12 PM
Subject: [trans] Hi Sanjeev.... - Java query.
Hi Sanjeev,
I came across ur reference on the internet. I am having some problems in using Hindi for my Java application. I have selected indic in the regional settings option for Win2000 professional and have generated the right resource bundle files. However, my application always shows up 'rectangles' instead of hindi characters....
Any idea as to what would be wrong in my settings. Help would be greatly appreciated.
Thanks,
----Anil