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

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).