Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 73204 invoked from network); 5 Dec 2006 16:54:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 16:54:46 -0000 Received: (qmail 84900 invoked by uid 500); 5 Dec 2006 16:54:51 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 84882 invoked by uid 500); 5 Dec 2006 16:54:51 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 84865 invoked by uid 99); 5 Dec 2006 16:54:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Dec 2006 08:54:51 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Dec 2006 08:54:42 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8148A7142E1 for ; Tue, 5 Dec 2006 08:54:22 -0800 (PST) Message-ID: <24038655.1165337662526.JavaMail.jira@brutus> Date: Tue, 5 Dec 2006 08:54:22 -0800 (PST) From: "Paulex Yang (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2439) [classlib][luni] java.io.OutputStreamWriter.write(int) writes bytes in UTF-8 incorrectly In-Reply-To: <33226945.1165245984899.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/HARMONY-2439?page=all ] Paulex Yang updated HARMONY-2439: --------------------------------- Summary: [classlib][luni] java.io.OutputStreamWriter.write(int) writes bytes in UTF-8 incorrectly (was: java.io.OutputStreamWriter.write(int) writes bytes in UTF-8 incorrectly) > [classlib][luni] java.io.OutputStreamWriter.write(int) writes bytes in UTF-8 incorrectly > ---------------------------------------------------------------------------------------- > > Key: HARMONY-2439 > URL: http://issues.apache.org/jira/browse/HARMONY-2439 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Anton Ivanov > > java.io.OutputStreamWriter works wrong when calling to its write(int) method if encoding specified is UTF-8. > Following test fails: > import java.io.*; > public class TestOutputStreamWriterUTF8 { > public static void main(String argv[]) throws Exception { > ByteArrayOutputStream out; > OutputStreamWriter writer = null; > InputStreamReader isr = null; > try { > out = new ByteArrayOutputStream(); > writer = new OutputStreamWriter(out, "UTF-8"); > int upper = 9000; > for (int c = 0; c < upper; ++c) { > writer.write(c); > } > writer.flush(); > byte[] result = out.toByteArray(); > isr = new InputStreamReader(new ByteArrayInputStream(result),"UTF-8"); > int expected = 0; > for (; expected < upper; ++expected) { > if (expected != isr.read()) { > System.out.println("test FAILED:" + expected +" "+ isr.read()); > break; > } > } > > if (expected == upper) { > System.out.println("test PASSED"); > } > isr.close(); > writer.close(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } -- 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