United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-5033780 : LANG should have higher precedence than LC_CTYPE for locale

Details
Type:
Bug
Submit Date:
2004-04-19
Status:
Closed
Updated Date:
2010-12-20
Project Name:
JDK
Resolved Date:
2010-12-20
Component:
core-libs
OS:
linux
Sub-Component:
java.util:i18n
CPU:
x86
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.4.0
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description

Name: jl125535			Date: 04/19/2004


FULL PRODUCT VERSION :
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)

This problem is reproducible on both 1.4.x and 1.5 beta.

ADDITIONAL OS VERSION INFORMATION :
Linux struggle.javabsp 2.6.3-ck1 #7 Mon Mar 22 00:34:34 PST 2004 i686 GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
LC_CTYPE=zh_TW.Big5
LANG=en_US

A DESCRIPTION OF THE PROBLEM :
When both LANG and LC_CTYPE are set, applications would use LC_CTYPE to decide the locale. For example, if LC_CTYPE is set to zh_TW.Big5, swing would display dialogs in Traditional Chinese, even though LANG is set to en_US. This is not what any linux applications do, which use LC_CTYPE only as a hint on charset conversion. See `man locale' for more details.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set LANG to en_US, and LC_CTYPE to anything other than an English encoding.
Run an application that has been localized to the encoding specified by LC_CTYPE, for example, any built-in swing dialogs support zh_TW.Big5 at least partially (you may need to configure java font setting to have the characters display correctly, but that's a whole new problem).

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Everything should still be displayed in English.
ACTUAL -
Swing dialogs uses Traditional Chinese

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
SwingSet2's dialog demo can demonstrate this problem.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Unset LC_CTYPE everytime before invoking java.
(Incident Review ID: 254811) 
======================================================================

                                    

Comments
EVALUATION

This has been fixed in JDK7 along with 4700857.
                                     
2010-12-20



Hardware and Software, Engineered to Work Together