JDK-4151938 : 11x: GetDisplayCountry does not return correct country for certain locales
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.1.6,1.1.7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.5.1,windows_nt
  • CPU: x86,sparc
  • Submitted: 1998-06-24
  • Updated: 1999-07-19
  • Resolved: 1999-07-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.1.8 1.1.8Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Description

Name: eyC74480			Date: 06/24/98


This is from Oracle, a Java licensee. 
The Oracle bug number is 675746. 
 
This bug did NOT occur with JDK 1.1.4 and JDK1.1.5
but is happening with 1.1.6. Please consider this a 
regression problem, and examine it ASAP. 
 
To reproduce this problem, compile the following test program with javac and
run with appletviewer.

import java.applet.Applet;
import java.awt.Graphics;
import java.util.Locale;
import java.lang.System;
public class JavaLocTester extends Applet
{
  public void paint(Graphics g)
  {
    Locale myLocale = Locale.getDefault();
    g.drawString("Language: "+ myLocale.getLanguage(), 50, 20);
    g.drawString("Country: "+ myLocale.getCountry(), 50, 40);
    g.drawString("Variant: "+ myLocale.getVariant(), 50, 60);
    g.drawString("toString: "+ myLocale.toString(), 50, 80);
    g.drawString("Display Language: "+ myLocale.getDisplayLanguage(), 50, 120)
    g.drawString("Display Country: "+ myLocale.getDisplayCountry(), 50, 140);
    g.drawString("Display Variant: "+ myLocale.getDisplayVariant(), 50, 160);
  }
}
This fails for Windows NT4 Regional Settings Arabic (U.A.E) and Korean.  The
Arabic choice correctly returned the Arabic name from the LocaleElements_ar
resource bundle defining the display country translation) with JDK1.1.4FCS
and the Korean choice correctly returned Korean name from LocaleElements_ko
withy JDK1.1.4FCS.  However, with JDK1.1.6 Korean and Arabic return KO and U
instead of the respective LocaleElelments country display name.
Other problem languages are:
Albanian
Arabic (all)
Bulgarian
Croatian
Czech
English (Belize)
English (Caribbean)
English (Jamaica)
English (South Africa)
English (Trinidad)
Estonian
Korean
Latvian
Lithuanian
Romanian
Slovak
Slovenian
Spanish (all other than Mexico, Modern Sort, and Traditional Sort)
Swedish (Finland)
(Review ID: 34153)
======================================================================

richard.gillam@eng 1998-08-13
Addendum:  I believe that bug #4151933 has the same underlying cause as this problem.  That bug complains that if the system default locale is Arabic (U.A.E.) and you do getCountry() on the default locale, you get back "U" instead of "AE".  Must verify that the fix for the above problem also takes care of this.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.1.8 FIXED IN: 1.1.8 INTEGRATED IN: 1.1.8
14-06-2004

EVALUATION The root cause of this problem is that the code in properties_md.c that picks up the default locale from the operating system isn't doing it correctly. This causes all the other locale functions that depend on the country code to do the wrong thing. For example, if the system default locale is "Latvian", the language code correctly comes back as "lv", but the country code incorrectly comes back as "LATVIAN" instead of "LV". In 1.1.5, this was being masked by the higher-level methods on Locale, which is why it's only showing symptoms now when it's been there all along. In 1.2, this problem was fixed by the fix for bug #4123370, but the problem still exists in 1.1. The solution is to backport that fix, but enough of the infrastructure has changed that this will be much more involved than a simple copy and paste. richard.gillam@eng 1998-08-13 ----------------------------------------------------------------------- Cannot verify this bug with jdk118h. Test returns no Country at all. al.smith@eng 1999-02-26
13-08-1998