bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/26760] wrong default encoding when writing to file


From: konqueror at gmx dot de
Subject: [Bug classpath/26760] wrong default encoding when writing to file
Date: 19 Mar 2006 16:04:06 -0000


------- Comment #2 from konqueror at gmx dot de  2006-03-19 16:04 -------
This testcase shows reality:

import java.io.*;

public class OutputTest2
{
  static class Test extends OutputStream
  {
    public void write(int value) throws IOException
    {
      System.out.println(Integer.toHexString(value));
    }
  }

  public static void main(String[] args) throws Exception
  {
    PrintWriter writer = new PrintWriter(new Test());

    writer.write("\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae");
    writer.close();
  }
}

The output is as like this:

(sid)address@hidden:~$ /usr/lib/j2sdk1.5-sun/bin/java OutputTest2
3f
3f
3f
3f
3f
3f
(sid)address@hidden:~$ /home/mkoch/local/jamvm/bin/jamvm OutputTest2
ffffffae
ffffffae
ffffffae
ffffffae
ffffffae
ffffffae

Looks like the bug is at least a bug in java.io.PrintWriter.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26760





reply via email to

[Prev in Thread] Current Thread [Next in Thread]