commit-classpath
[Top][All Lists]
Advanced

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

[Bug #2105] String.getBytes("UTF8") broken for non-zero offset strings


From: nobody
Subject: [Bug #2105] String.getBytes("UTF8") broken for non-zero offset strings
Date: Sat, 18 Jan 2003 17:43:04 -0500

=================== BUG #2105: LATEST MODIFICATIONS ==================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=2105&group_id=85

Changes by: Mark Wielaard <address@hidden>
Date: 2003-Jan-18 23:43 (Europe/Amsterdam)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
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.



=================== BUG #2105: FULL BUG SNAPSHOT ===================


Submitted by: archie172               Project: classpath                    
Submitted on: 2003-Jan-01 18:34
Severity:  5 - Major                  Resolution:  Fixed                    
Assigned to:  None                    Status:  Closed                       
Platform Version:  None               

Summary:  String.getBytes("UTF8") broken for non-zero offset strings

Original Submission:  [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 (!). 

Follow-up Comments
*******************

-------------------------------------------------------
Date: 2003-Jan-18 23:43             By: mark
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.

-------------------------------------------------------
Date: 2003-Jan-02 02:57             By: archie172
Oops, previous patch is incomplete, I've attached
a new one.



CC list is empty


File Attachments
****************

-------------------------------------------------------
Date: 2003-Jan-02 02:57  Name: Encoder.java.patch  Size: 1KB   By: archie172
More complete patch to fix the bug(s)
http://savannah.gnu.org/bugs/download.php?group_id=85&amp;bug_id=2105&amp;bug_file_id=222

-------------------------------------------------------
Date: 2003-Jan-01 18:37  Name: Encoder.java.patch  Size: 0KB   By: archie172

http://savannah.gnu.org/bugs/download.php?group_id=85&amp;bug_id=2105&amp;bug_file_id=221

-------------------------------------------------------
Date: 2003-Jan-01 18:37  Name: UTF8.java  Size: 0KB   By: archie172
Test program.
http://savannah.gnu.org/bugs/download.php?group_id=85&amp;bug_id=2105&amp;bug_file_id=220


For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=2105&group_id=85




reply via email to

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