Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 65728 invoked from network); 4 Dec 2006 15:26:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2006 15:26:57 -0000 Received: (qmail 95479 invoked by uid 500); 4 Dec 2006 15:26:55 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 95432 invoked by uid 500); 4 Dec 2006 15:26:54 -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 95282 invoked by uid 99); 4 Dec 2006 15:26:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 07:26:54 -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; Mon, 04 Dec 2006 07:26:45 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DC2937142F7 for ; Mon, 4 Dec 2006 07:26:24 -0800 (PST) Message-ID: <33226945.1165245984899.JavaMail.jira@brutus> Date: Mon, 4 Dec 2006 07:26:24 -0800 (PST) From: "Anton Ivanov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-2439) java.io.OutputStreamWriter.write(int) writes bytes in UTF-8 incorrectly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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