Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4038677
Votes 9
Synopsis In DOS prompt java prints in iso-8859-2 not CP-852 in poli
Category java:char_encodings
Reported Against 1.1
Release Fixed
State 11-Closed, Will Not Fix, bug
Priority: 5-Very Low
Related Bugs 5046759
Submit Date 13-MAR-1997
Description


Unicode text printed with System.out.println in application run 
with java prints text using iso-8859-2 charset not CP-852 used by
Command Prompt in Windows.


======================================================================

One of our licensees has this to add....

The problem I am encountering is that the java environment has the
encoding (file.encoding systems property) to be 8859_1.  The DOS
console thinks it is Cp850.
When the tool prints the UNICODE character \u00D6, the java environment
converts it to code point D6 in the 8859_1 codepage.  When it is 
displayed on the DOS console, it is an the D6 codepoint of the 850 table.
I checked the javasoft "bugParade" finding two relevant
bugs , 4038677 and 4080134.  4038677 is my exact problem except that
this person encountered it using 8859_2 and Cp852.  Neither of the bug
reports offer work around or have any reply from javasoft.  
This is a big problem for me.

- mick.fleming
Work Around



======================================================================
Evaluation
The underlying issue is the dual codepage support (ansi & oem codepages) which
differentiates the default codepage used for console i/o and display and
windows based display. J2SE runtime chooses the ANSI codepage when determining
the default encoding whereas native console codepage is the OEM codepage.
RFE 4153167 expresses a desire for either API support or automagical support
of some kind which would allow the VM bootstrapping process to either
automatically detect the appropriate (ANSI or OEM) codepage and choose the
requisite default encoding based on that determination.

However this is not an issue determined to be of high priority at this time,
Also this bug was raised on a very old j2se release 1.1.x. Since no significant
business case exists or is apparent with this issue I am closing this bug
out now as will not fix.
 xxxxx@xxxxx  2004-01-15
Comments
  
  Include a link with my name & email   

Submitted On 04-FEB-1998
McKennaP
I talked to a colleague about this problem.  We are trying to use a Java
properties file to retrieve
our messages.  We display our messages on System.out and to the file.  If our
properties file is converted
to ISO_8859_1 (using native2ascii) then special characters in French or German
do not get displayed 
correctly in a Windows NT command (i.e. Dos) window.  My colleague suggested a
workaround of specifying the 
file.encoding on the java command to
be Cp850.  This had an effect but did not work.  I then experimented trying to
use an OutputStreamWriter and for
the purpose of my test, I tried hardcoding "Cp850" as the encoding. 
I found out from doing this that 
the JRE does not support this encoding -- this is true for both the
JRE 1.1.4 and JRE 1.1.5 on NT.
   So, my first question is "why is Cp850 not supported on the
JREs?".
   Since the JRE does not support Cp850, what effect will specifying the
file.encoding=Cp850 have when running the JRE.  It does not cause an exception
nor does it work.
I would like for it to be my silver bullet; make the output to the screen look
correct on
System.out.println calls and have the ISO_8859_1 encoding be used when writing
to the
file.  I am concerned that setting the file.encoding=Cp850 will adversely
affect my
file output.


Submitted On 07-APR-1998
SWOLICKI
One extra comment: for both US Windows and Polish Windows environment the
standard file.encoding is not iso-8859-x but cp1250 for Polish and cp1252 for
US. Use:
      Properties p = System.getProperties();
      System.out.println( p );
to check it.


Submitted On 07-APR-1998
SWOLICKI
I have just investigated the problem for the Polish customer. It seems that
specifying -Dfile.encoding=cp852 on java's command line solves it for Polish. 
I wonder why it should not work for cp850. Look into i18n.jar coming with JDK.
Cp850 CharToByte converter is there.
Maybe some programming problem? Or Console Window configuration problem?


Submitted On 05-FEB-2001
zhouyi
This is a important bug, I have same problem to face. We 
try to use our java program to be supported on command line 
interface, but the out put character for FR and DE's accent 
character are not correct. I don't who has a good idea for 
this bug. I hope sun can fix this.



PLEASE NOTE: JDK6 is formerly known as Project Mustang