JDK-6911764 : Default Locale NOT being set from "non-Unicode programs" setting
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 6u16
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-12-18
  • Updated: 2011-02-16
  • Resolved: 2009-12-18
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Using French keyboard, French(France) Regional options, Location=France, Language for menus and dialogs=English, non-Unicode program language set to English (United States)

A DESCRIPTION OF THE PROBLEM :
With those settings internationalized java apps ALWAYS display French NOT English.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set up the Regional and Language options as above, run an internationalized Java program.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
GUI in English (as stated on http://java.com/en/download/help/locale.xml)
ACTUAL -
GUI in French

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
In fact there are two answers I found - the WRONG one presented by
http://java.com/en/download/help/locale.xml and the hack one that works.

I'll explain - I use a French-installed multi-language XP in France with
a French keyboard - but I want my apps to speak to me in English. The
page at Sun plain does not work with that combination - Java still talks
to me in French.

The HACK solution was to go into regedit and change

HKEY_CURRENT_USER\Control Panel\International\Locale

from 0000040C to 00000409. That made Java talk English.

Going back to the regional settings control panel tool, I noticed that
this, in fact, had changed the name in the "Regional Options" drop down,
while keeping all the French formatting for numbers dates etc.

So Java does NOT get its default LOCALE
from the settings on the Advanced page, but from the settings on the
Regional Options page - and THEY are very tough to change without screwing
up ALL those options (i.e. you can't easily just change the language and
leave the number/date/etc formatting as is).

Comments
EVALUATION In old Windows environment (pre Win2K), there were two locale settings in Windows control panel. One is the "User Locale", and the other is the "System Locale". Java predates Win2K, so Java's default Locale is set from Windows "User Locale" because the "System Locale" is as the name implies, per the machine, not per user. Now, MS changed the names for those two settings to "Standards and Formats" and "Language for non-Unicode programs" respectively. That is the history Java's default locale is based on the "Standards and Formats" setting. Furthermore, MS has introduced the new "UI Language" that should be used as the locale for the UI. There is a feature request (4700857) to support this "UI Language" in Java, and possibly optionally have it as the default Java locale, so that the user can specify the UI messages and date/number/time formattings separately. I am closing this bug as a duplicate of that feature request as it will solve the situation in the description section.
18-12-2009