[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/26760] New: wrong default encoding when writing to file
From: |
konqueror at gmx dot de |
Subject: |
[Bug classpath/26760] New: wrong default encoding when writing to file |
Date: |
19 Mar 2006 15:06:35 -0000 |
The following testcase writes different contents to files when using
jamvm/classpath and SUN JDK.
import java.io.*;
public class FileTest
{
public static void main(String[] args) throws Exception
{
FileWriter fileWriter = new FileWriter(args[0]);
PrintWriter writer = new PrintWriter(new BufferedWriter(fileWriter), true);
writer.write("\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae");
writer.close();
}
}
When using SUN I get this (hexdump output):
(sid)address@hidden:~$ hexdump test2.out
0000000 3f3f 3f3f 3f3f
0000006
When using jamvm/classpath I get the following:
(sid)address@hidden:~$ hexdump test.out
0000000 aeae aeae aeae
0000006
It seems that in the SUN-case the character \u00ae is converted to a quetion
mark as this is no ascii character. In the jamvm/classpath case the lower byte
is just ased as asci character.
--
Summary: wrong default encoding when writing to file
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: konqueror at gmx dot de
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26760
- [Bug classpath/26760] New: wrong default encoding when writing to file,
konqueror at gmx dot de <=
- [Bug classpath/26760] wrong default encoding when writing to file, konqueror at gmx dot de, 2006/03/19
- [Bug classpath/26760] wrong default encoding when writing to file, konqueror at gmx dot de, 2006/03/19
- [Bug classpath/26760] wrong default encoding when writing to file, konqueror at gmx dot de, 2006/03/19
- [Bug classpath/26760] wrong default encoding when writing to file, konqueror at gmx dot de, 2006/03/19
- [Bug classpath/26760] wrong default encoding when writing to file, audriusa at bluewin dot ch, 2006/03/24