JDK-4242737 : 1.1: -Dfile.encoding does not work with HOTSPOT and JAVA2 (1.2.1)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.0
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_95
  • CPU: x86
  • Submitted: 1999-06-01
  • Updated: 2012-10-08
  • Resolved: 1999-06-01
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 alphaFixed
Related Reports
Relates :  
Description
Name: mc57594			Date: 05/31/99

Bug observed on Win 95 and NT, but not Solaris.

I generated a class which just prints the default file Encoding 
classes used by the sun.io ByteToCharConverter and CharToByteConverter classes.

package com.gil.test;
import sun.io.*;
public class Encoding
{
   /**
    * Encoding constructor comment.
    */
   public Encoding() {
   }
   /**
    * This method was created in VisualAge.
    * @param args java.lang.String[]
    */
   public static void main(String args[])
   {
   	System.out.println("Default ByteToChar Class >>'" + sun.io.ByteToCharConverter.getDefault().getClass().getName() + "'");
   	System.out.println("Default CharToByte Class >>'" + sun.io.CharToByteConverter.getDefault().getClass().getName() + "'");
   }
}

if I execute the above class and set the file encoding on the command line:

java -Dfile.encoding=8859_1 -cp . com.gil.test.Encoding

I get the following output:

Default ByteToChar Class >>'sun.io.ByteToCharCp1252'
Default CharToByte Class >>'sun.io.CharToByteCp1252'

If I use the -classic option, to not use Hotspot I get:

Default ByteToChar Class >>'sun.io.ByteToCharISO8859_1'
Default CharToByte Class >>'sun.io.CharToByteISO8859_1'

So it appears that the file encoding does not get set when 
using hotspot.
(Review ID: 83242) 
======================================================================

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

WORK AROUND Name: mc57594 Date: 05/31/99 Don't use hotspot. ======================================================================
11-06-2004

EVALUATION Setting of -Dfile.encoding=XXX did not work since the coversion classes got initialized to early. Fixed setting of properties to use native code in java.dll instead of calling java code. rene.schmidt@eng 1999-06-01
01-06-1999