[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug(s) in java.lang.String
From: |
Mark Wielaard |
Subject: |
Re: Bug(s) in java.lang.String |
Date: |
Wed, 14 Aug 2002 22:36:14 +0200 |
User-agent: |
Mutt/1.4i |
Hi,
On Wed, Aug 14, 2002 at 01:10:00PM -0700, Benenati, ChrisX J wrote:
> There seems to be a related problem with getBytes(String enc) and
> getBytes().
>
> Running under ORP, these methods are returning all of the trailing nul bytes
> as well as the valid characters in the String.
This seems like a bug in gnu.java.io.encode.Encoder.
Index: gnu/java/io/encode/Encoder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/io/encode/Encoder.java,v
retrieving revision 1.3
diff -u -r1.3 Encoder.java
--- gnu/java/io/encode/Encoder.java 22 Jan 2002 22:26:57 -0000 1.3
+++ gnu/java/io/encode/Encoder.java 14 Aug 2002 20:27:41 -0000
@@ -227,9 +227,9 @@
public byte[]
convertToBytes(char[] buf, int offset, int len) throws CharConversionException
{
- byte[] bbuf = new byte[bytesInCharArray(buf)];
+ byte[] bbuf = new byte[bytesInCharArray(buf, offset, len)];
- return(convertToBytes(buf, offset, len, bbuf, offset));
+ return(convertToBytes(buf, offset, len, bbuf, 0));
}
/*************************************************************************/
This was found by just reading the code since I am unable to compile and
test/run at the moment. So this might not be it. But if you could try it
out that would be highly appreciated.
Thanks,
Mark
--
GNU/Linux is becoming popular for practical reasons. It's a good system.
The danger is people will like it because it's practical and it will become
popular without anyone having the vaguest idea of the ideals behind it,
which would be an ironic way of failing. <http://www.gnu.org/philosophy/>