Name: gm110360 Date: 07/16/2003
FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
ServicePack 4
EXTRA RELEVANT SYSTEM CONFIGURATION :
German Version
A DESCRIPTION OF THE PROBLEM :
Java program which was started with java gets an other default locale than a program which was started with javaw.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Changing OS locale to other locale (Start->Settings->ControlPanel->RegionalOptions).
Java program reads out default locale with Locale.getDefault() and gives it out.
Starting java program with java: class gets correct (changed) locale from OS.
Starting java program with javaw: class gets locale from before the changes.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Starting java program with java: class gets correct (changed) locale from OS.
Starting java program with javaw: class gets correct (changed) locale from OS.
ACTUAL -
Starting java program with java: class gets correct (changed) locale from OS.
Starting java program with javaw: class gets locale from before the changes.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.*;
import java.io.*;
public class Test
{
public static void main(String[] args)
{
Locale myLocale = Locale.getDefault();
File f = new File("test.txt");
try
{
FileOutputStream fos = new FileOutputStream(f);
fos.write(myLocale.toString().getBytes());
}
catch(FileNotFoundException fnfe)
{
fnfe.printStackTrace();
}
catch(IOException io)
{
io.printStackTrace();
}
}
}
---------- END SOURCE ----------
(Incident Review ID: 191650)
======================================================================
Name: rmT116609 Date: 07/21/2003
FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
FULL OS VERSION :
Microsoft Windows XP [Version 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
User Default Locale : 3079
System Default Locale : 1033
Country : Austria
Language : German (Austria)
Time Zone : W. Europe Standard Time
ANSI Code Page : 1252
OEM Code Page : 850
A DESCRIPTION OF THE PROBLEM :
The JRE uses the wrong default locale when "javaw" is used.
Note: this is an update for
http://developer.java.sun.com/developer/bugParade/bugs/4854349.html
Might be related to
http://developer.java.sun.com/developer/bugParade/bugs/4629351.html
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set the locales as shown above.
Run the example code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Should always report "default: de_AT"
ACTUAL -
When run with "javaw" reports: "default: en_US"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.JOptionPane;
import java.util.Locale;
public class Demo {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "default: " +Locale.getDefault());
System.exit(0);
}
}
---------- END SOURCE ----------
(Review ID: 189582)
======================================================================