JDK-6522209 : Unable to get values for customised system locale
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-02-07
  • Updated: 2011-02-16
  • Resolved: 2007-02-07
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REQUEST :
Windows XP, MacOS X and other operating systems allow a user to select a locale and the customise the locale's attributes. For example, a user might decide their locale is US English, but they want 24 hour time format.

If I write an AWT or Swing based application, I would like to present localised data in the format that the user selected at system level. After discussing with other people in the forums and some experimentation, there does not seem to be any support for this in JDK 1.5 or 1.6.

I would expect the 'default' locale to return whatever the user selected at the system level.

JUSTIFICATION :
If I write an AWT or Swing based application, I would like to present localised data in the format that the user selected at system level. The user is likely to blame the application for getting this wrong, even if it is a limitation of the API.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Default or a 'special' locale returns the locale the user customised at the system level.
ACTUAL -
Returns a static locale. If the base locale is US, then the settings for US are returned, ignoring the user customisations.

CUSTOMER SUBMITTED WORKAROUND :
The only workaround would be to use a JNI interface, but this would mean requiring writing native code for multiple platforms.