[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/22660] String.getBytes("UTF8") broken for non-zero offset
From: |
gcc-bugzilla at gcc dot gnu dot org |
Subject: |
[Bug classpath/22660] String.getBytes("UTF8") broken for non-zero offset strings |
Date: |
16 Oct 2005 01:26:22 -0000 |
[this bug originally filed against SableVM 1.0.5]
There is a bug in the class
gnu/java/io/encode/Encoder.java.
If a String has a non-zero offset into its char[] array
then
things get screwey.
The attached file UTF8.java demonstrates the bug.
It generates this output:
$ sablevm UTF8
bytes.length=20
bytes: 61 62 63 64 31 32 33 34 0 0 0 0 0 0 0 0 0 0 0 0
Other possibilities include the first byte being zero (!).
------- Comment #1 from from-classpath at savannah dot gnu dot org 2003-01-02
01:57 -------
Oops, previous patch is incomplete, I've attached
a new one.
------- Comment #2 from from-classpath at savannah dot gnu dot org 2003-01-18
22:43 -------
Thanks for catching this. I installed the patch for UTF8Encoder and made a
Mauve test for it. Note that SableVM uses an older version of GNU Classpath.
The first part of your patch (for Encoder) was already fixed last year in CVS.
------- Comment #3 from from-classpath at savannah dot gnu dot org 2003-01-18
22:45 -------
Thanks for catching this. I installed the patch for UTF8Encoder and made a
Mauve test for it. Note that SableVM uses an older version of GNU Classpath.
The first part of your patch (for Encoder) was already fixed last year in CVS.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22660
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug classpath/22660] String.getBytes("UTF8") broken for non-zero offset strings,
gcc-bugzilla at gcc dot gnu dot org <=