Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 95530 invoked from network); 30 Mar 2006 08:58:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Mar 2006 08:58:54 -0000 Received: (qmail 1589 invoked by uid 500); 30 Mar 2006 08:58:49 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 1548 invoked by uid 500); 30 Mar 2006 08:58:48 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 1534 invoked by uid 99); 30 Mar 2006 08:58:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2006 00:58:48 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2006 00:58:48 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 204166ACB2 for ; Thu, 30 Mar 2006 09:58:27 +0100 (BST) Message-ID: <928409081.1143709107129.JavaMail.jira@ajax> Date: Thu, 30 Mar 2006 09:58:27 +0100 (BST) From: "Tim Ellison (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Closed: (HARMONY-173) java.nio.charset.CharsetEncoder.encode method does not reserve remaining bytes for next invocation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-173?page=all ] Tim Ellison closed HARMONY-173: ------------------------------- Verified by Richard > java.nio.charset.CharsetEncoder.encode method does not reserve remaining bytes for next invocation. > --------------------------------------------------------------------------------------------------- > > Key: HARMONY-173 > URL: http://issues.apache.org/jira/browse/HARMONY-173 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Richard Liang > Assignee: Tim Ellison > Attachments: CharsetEncoderTest_patch_173.txt, CharsetEncoder_patch_173.txt > > Method > public final CoderResult encode(CharBuffer in, > ByteBuffer out, > boolean endOfInput) > Considering that there is a supplemental character which represents by 4 bytes like "\ud800\udc00", and it was divided into two input buffers. e.g. "\ud800" is at the end of input1 and the "\udc00" is at the begining of input2. when invoking the method encode(input1,out,false), it deals with "\ud800" as a malformed charactor and I think it should be reversed for next invocation like encode(input2,out,true). > And it aslo must be handled correspondingly in method public final ByteBuffer encode(CharBuffer in). > ===Test segment to reproduce the bug (fail on RI 5.0 and Harmony. I think it's also a bug for RI 5.0) > CharsetEncoder encoder = Charset.forName("utf-8").newEncoder(); > CharBuffer in1 = CharBuffer.wrap("\ud800"); > CharBuffer in2 = CharBuffer.wrap("\udc00"); > ByteBuffer out = ByteBuffer.allocate(4); > encoder.reset(); > CoderResult result = encoder.encode(in1, out, false); > assertEquals(4, out.remaining()); > assertTrue(result.isUnderflow()); > result = encoder.encode(in2, out, true); > assertEquals(0, out.remaining()); > assertTrue(result.isUnderflow()); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira