public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/29178] New: CharsetEncoder.canEncode() gives different results than Sun version
@ 2006-09-22 8:21 marcus at better dot se
2006-09-22 17:27 ` [Bug libgcj/29178] " tromey at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: marcus at better dot se @ 2006-09-22 8:21 UTC (permalink / raw)
To: gcc-bugs
The following test program gives different results with gcj and Sun JDK:
// A.java
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
public class A {
public static void main(String[] args) throws java.io.IOException
{
CharsetEncoder enc = Charset.forName("US-ASCII").newEncoder();
System.out.println(enc.canEncode('\u00e4'));
}
}
// end
$ javac A.java
$ /usr/lib/jvm/java-1.5.0-sun/bin/java A
false
$ /usr/lib/jvm/java-gcj/bin/java A
true
The Sun version seems to return something like (c > 31 && c < 127),
which makes sense, whereas gcj apparently always returns true.
This breaks lots of code, such as Apache JaxMe 2 version 0.51
(specifically the MarshallerTest in the test suite, which generated
invalid XML with gcj).
This was tested on Debian (testing, i386).
~$ gcj --version
gcj (GCC) 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)
The bug was also reported to Debian's bug tracking system:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=388596
--
Summary: CharsetEncoder.canEncode() gives different results than
Sun version
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: marcus at better dot se
GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29178
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/29178] CharsetEncoder.canEncode() gives different results than Sun version
2006-09-22 8:21 [Bug libgcj/29178] New: CharsetEncoder.canEncode() gives different results than Sun version marcus at better dot se
@ 2006-09-22 17:27 ` tromey at gcc dot gnu dot org
2006-09-25 18:56 ` tromey at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-09-22 17:27 UTC (permalink / raw)
To: gcc-bugs
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-09-22 17:27:21
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29178
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/29178] CharsetEncoder.canEncode() gives different results than Sun version
2006-09-22 8:21 [Bug libgcj/29178] New: CharsetEncoder.canEncode() gives different results than Sun version marcus at better dot se
2006-09-22 17:27 ` [Bug libgcj/29178] " tromey at gcc dot gnu dot org
@ 2006-09-25 18:56 ` tromey at gcc dot gnu dot org
2006-09-25 19:20 ` cvs-commit at developer dot classpath dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-09-25 18:56 UTC (permalink / raw)
To: gcc-bugs
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |tromey at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2006-09-22 17:27:21 |2006-09-25 18:55:50
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29178
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/29178] CharsetEncoder.canEncode() gives different results than Sun version
2006-09-22 8:21 [Bug libgcj/29178] New: CharsetEncoder.canEncode() gives different results than Sun version marcus at better dot se
2006-09-22 17:27 ` [Bug libgcj/29178] " tromey at gcc dot gnu dot org
2006-09-25 18:56 ` tromey at gcc dot gnu dot org
@ 2006-09-25 19:20 ` cvs-commit at developer dot classpath dot org
2006-09-25 21:04 ` tromey at gcc dot gnu dot org
2006-09-25 21:22 ` tromey at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at developer dot classpath dot org @ 2006-09-25 19:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from cvs-commit at developer dot classpath dot org 2006-09-25 19:20 -------
Subject: Bug 29178
CVSROOT: /cvsroot/classpath
Module name: classpath
Changes by: Tom Tromey <tromey> 06/09/25 19:19:47
Modified files:
gnu/java/nio/charset: ISO_8859_1.java US_ASCII.java
ByteCharset.java
. : ChangeLog
Log message:
PR libgcj/29178:
* gnu/java/nio/charset/US_ASCII.java (Encoder.canEncode): New
method.
(Encoder.canEncode): Likewise.
(Encoder.encodeLoop): Return unmappable for all non-ASCII
characters.
* gnu/java/nio/charset/ByteCharset.java (Encoder.canEncode):
New
method.
(Encoder.canEncode): Likewise.
* gnu/java/nio/charset/ISO_8859_1.java (Encoder.canEncode): New
method.
(Encoder.canEncode): Likewise.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/charset/ISO_8859_1.java?cvsroot=classpath&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/charset/US_ASCII.java?cvsroot=classpath&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/nio/charset/ByteCharset.java?cvsroot=classpath&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.8609&r2=1.8610
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29178
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/29178] CharsetEncoder.canEncode() gives different results than Sun version
2006-09-22 8:21 [Bug libgcj/29178] New: CharsetEncoder.canEncode() gives different results than Sun version marcus at better dot se
` (2 preceding siblings ...)
2006-09-25 19:20 ` cvs-commit at developer dot classpath dot org
@ 2006-09-25 21:04 ` tromey at gcc dot gnu dot org
2006-09-25 21:22 ` tromey at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-09-25 21:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from tromey at gcc dot gnu dot org 2006-09-25 21:04 -------
Subject: Bug 29178
Author: tromey
Date: Mon Sep 25 21:04:01 2006
New Revision: 117209
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117209
Log:
PR libgcj/29178:
* gnu/java/nio/charset/US_ASCII.java (Encoder.canEncode): New method.
(Encoder.canEncode): Likewise.
(Encoder.encodeLoop): Return unmappable for all non-ASCII characters.
* gnu/java/nio/charset/ByteCharset.java (Encoder.canEncode): New
method.
(Encoder.canEncode): Likewise.
* gnu/java/nio/charset/ISO_8859_1.java (Encoder.canEncode): New
method.
(Encoder.canEncode): Likewise.
Modified:
trunk/libjava/classpath/ChangeLog.gcj
trunk/libjava/classpath/gnu/java/nio/charset/ByteCharset.java
trunk/libjava/classpath/gnu/java/nio/charset/ISO_8859_1.java
trunk/libjava/classpath/gnu/java/nio/charset/US_ASCII.java
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29178
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/29178] CharsetEncoder.canEncode() gives different results than Sun version
2006-09-22 8:21 [Bug libgcj/29178] New: CharsetEncoder.canEncode() gives different results than Sun version marcus at better dot se
` (3 preceding siblings ...)
2006-09-25 21:04 ` tromey at gcc dot gnu dot org
@ 2006-09-25 21:22 ` tromey at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-09-25 21:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from tromey at gcc dot gnu dot org 2006-09-25 21:22 -------
Fix checked in.
I'm not planning to back-port this to 4.1.
A 4.1 fix couldn't include the new methods, for binary compatibility.
But it could include the one hunk for the comparison, which would
suffice.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29178
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-25 21:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-22 8:21 [Bug libgcj/29178] New: CharsetEncoder.canEncode() gives different results than Sun version marcus at better dot se
2006-09-22 17:27 ` [Bug libgcj/29178] " tromey at gcc dot gnu dot org
2006-09-25 18:56 ` tromey at gcc dot gnu dot org
2006-09-25 19:20 ` cvs-commit at developer dot classpath dot org
2006-09-25 21:04 ` tromey at gcc dot gnu dot org
2006-09-25 21:22 ` tromey at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).