JDK-4464393 : Special characters not echoed back correctly
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 1.3.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-05-30
  • Updated: 2001-08-01
  • Resolved: 2001-08-01
Related Reports
Duplicate :  
Description

Name: bsC130419			Date: 05/30/2001


java version "1.3.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1
Java HotSpot(TM) Client VM (build 1.3.1beta-b15, mixed mode)

1.  Here is the source code of the program to be compiled:

public class SpecChar{
    public static void main (String args[]) {
        System.out.println(args[0]);
    }
}

2.  Execute with the command "java SpecChar <ALT 130>".  I would expect the special
character ? (ALT + 130) to be echoed.

3.  The actual result is the Greek character theta (don't know the ALT+XXX
combination for it), and not ?.
(Review ID: 124877) 
======================================================================

Comments
EVALUATION ALT<key> + numeric 130 within an MSDOS terminal shell generates the character 0x82 which is a small e with acute within the CP437 encoding. The Java program however infers the default encoding to be Windows-1252 and so after conversion to U+00E9 (Unicode allocated character for latin small e with acute) it is translated (according to Cp1252) back into the native codepoint, 0xE9 which happens to be a Greek captial theta sign/letter. This really is equivalent to bug 4369481: file.encoding CP1252 improperly displays \u00b2 on Windows. In both cases the issue is the fashion in which the Java runtime determines the default encoding to be windows-1252 and this gives unexpected results when displaying output on a DOS terminal shell within the win32 environment because the active codepage in the DOS terminal shell for US/Euro English systems is Cp437. ian.little@Ireland 2001-08-01
01-08-2001