FULL PRODUCT VERSION :
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Win XP Pro SP2 German Edition
Locale set to DE_de
A DESCRIPTION OF THE PROBLEM :
Current handling of umlauts in Preferences are problematic on Windows. Using umlauts in value names result in very, very long and kryptic names used in the Windows registry, while using umlauts in String values are handled quite well.
There are two problems with this:
(a) Users often want to modify settings by a tool called regedit. This is not possible now, because of the totally kryptic names.
(b) Coders want to export and then re-import the Preferences to xml. This is not possible now, because the kryptic names tend to be much too long, which results in an exception when re-importing.
To be clear: The problem is NOT the handling done in the VALUE (/uXXX for umlauts, /X for upper case) which would be absolutely ok for names, too. The problem is ONLY the totally kryptic "/!!%4!\..." stuff of the NAME.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the sample program shown below.
Use regedit and try to understand the NAME (VALUE is ok).
Use regedit to export the registry node so you can compare its file content with the one shown below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\JavaSoft\Prefs\preferencesbug]
"/Names with blanks and umlauts /u00e4/u00fc/u00f6/u00df/u00c4/u00d6/u00dc/u20ac are quite common in /Europe"="/Values with blanks and umlauts /u00e4/u00fc/u00f6/u00df/u00c4/u00d6/u00dc/u20ac are quite common in /Europe"
ACTUAL -
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\JavaSoft\Prefs\preferencesbug]
"/!!%4!}@\"t!'`!cw!g!(c!a@\"0!'g!)!\"i!'w!}@\"u!'s!cw!g!'%!bg\"k!#!!d@\"t!'w!}@\"1!(@!cw!g!<@!?!$2!;8!x!${!;wgr!!g!'%!cg\"l!#!!c@\"1!'k!d!\"l!#!!}w\"v!'0!b@\"v!'4!)!\"p!'4!)!\"&!(`!cg\"v!(!!~@=="="/Values with blanks and umlauts /u00e4/u00fc/u00f6/u00df/u00c4/u00d6/u00dc/u20ac are quite common in /Europe"
ERROR MESSAGES/STACK TRACES THAT OCCUR :
When trying to export and then re-import names including umlauts, it can be the case the the strange encryption makes the names becoming too long, resulting in this exception. In fact, this is the main problem. Readability is only secondary.
java.lang.IllegalArgumentException: Node name Beschreibung verursachende Kostenstelle(Eingabe) too long
at java.util.prefs.AbstractPreferences.node(Unknown Source)
at java.util.prefs.AbstractPreferences.node(Unknown Source)
at java.util.prefs.XmlSupport.ImportSubtree(Unknown Source)
at java.util.prefs.XmlSupport.ImportSubtree(Unknown Source)
at java.util.prefs.XmlSupport.importPreferences(Unknown Source)
at java.util.prefs.Preferences.importPreferences(Unknown Source)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package preferencesbug;
import java.util.prefs.Preferences;
public class PreferencesBug {
public static void main(String[] args) {
Preferences p = Preferences.userNodeForPackage(PreferencesBug.class);
p.put("Names with blanks and umlauts are quite common in Europe", "Values with blanks and umlauts are quite common in Europe");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Do not use umlauts in names.
This is not acceptable in Europe.
Umlauts are no gimmick.
They are an essential part of many European alphabets.
An ä is not an a with two dots.
Its its own character.
To make you understand this, please try to imagine what happens to your country if Java would encrpyt every simple character like 'e' by such a strange code like '!!%2183`]'...
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Win XP Pro SP2 German Edition
Locale set to DE_de
A DESCRIPTION OF THE PROBLEM :
Current handling of umlauts in Preferences are problematic on Windows. Using umlauts in value names result in very, very long and kryptic names used in the Windows registry, while using umlauts in String values are handled quite well.
There are two problems with this:
(a) Users often want to modify settings by a tool called regedit. This is not possible now, because of the totally kryptic names.
(b) Coders want to export and then re-import the Preferences to xml. This is not possible now, because the kryptic names tend to be much too long, which results in an exception when re-importing.
To be clear: The problem is NOT the handling done in the VALUE (/uXXX for umlauts, /X for upper case) which would be absolutely ok for names, too. The problem is ONLY the totally kryptic "/!!%4!\..." stuff of the NAME.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the sample program shown below.
Use regedit and try to understand the NAME (VALUE is ok).
Use regedit to export the registry node so you can compare its file content with the one shown below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\JavaSoft\Prefs\preferencesbug]
"/Names with blanks and umlauts /u00e4/u00fc/u00f6/u00df/u00c4/u00d6/u00dc/u20ac are quite common in /Europe"="/Values with blanks and umlauts /u00e4/u00fc/u00f6/u00df/u00c4/u00d6/u00dc/u20ac are quite common in /Europe"
ACTUAL -
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\JavaSoft\Prefs\preferencesbug]
"/!!%4!}@\"t!'`!cw!g!(c!a@\"0!'g!)!\"i!'w!}@\"u!'s!cw!g!'%!bg\"k!#!!d@\"t!'w!}@\"1!(@!cw!g!<@!?!$2!;8!x!${!;wgr!!g!'%!cg\"l!#!!c@\"1!'k!d!\"l!#!!}w\"v!'0!b@\"v!'4!)!\"p!'4!)!\"&!(`!cg\"v!(!!~@=="="/Values with blanks and umlauts /u00e4/u00fc/u00f6/u00df/u00c4/u00d6/u00dc/u20ac are quite common in /Europe"
ERROR MESSAGES/STACK TRACES THAT OCCUR :
When trying to export and then re-import names including umlauts, it can be the case the the strange encryption makes the names becoming too long, resulting in this exception. In fact, this is the main problem. Readability is only secondary.
java.lang.IllegalArgumentException: Node name Beschreibung verursachende Kostenstelle(Eingabe) too long
at java.util.prefs.AbstractPreferences.node(Unknown Source)
at java.util.prefs.AbstractPreferences.node(Unknown Source)
at java.util.prefs.XmlSupport.ImportSubtree(Unknown Source)
at java.util.prefs.XmlSupport.ImportSubtree(Unknown Source)
at java.util.prefs.XmlSupport.importPreferences(Unknown Source)
at java.util.prefs.Preferences.importPreferences(Unknown Source)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package preferencesbug;
import java.util.prefs.Preferences;
public class PreferencesBug {
public static void main(String[] args) {
Preferences p = Preferences.userNodeForPackage(PreferencesBug.class);
p.put("Names with blanks and umlauts are quite common in Europe", "Values with blanks and umlauts are quite common in Europe");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Do not use umlauts in names.
This is not acceptable in Europe.
Umlauts are no gimmick.
They are an essential part of many European alphabets.
An ä is not an a with two dots.
Its its own character.
To make you understand this, please try to imagine what happens to your country if Java would encrpyt every simple character like 'e' by such a strange code like '!!%2183`]'...