Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 95568 invoked from network); 28 Oct 2009 06:16:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Oct 2009 06:16:23 -0000 Received: (qmail 74467 invoked by uid 500); 28 Oct 2009 06:16:22 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 74356 invoked by uid 500); 28 Oct 2009 06:16:22 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 74346 invoked by uid 99); 28 Oct 2009 06:16:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2009 06:16:21 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2009 06:16:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5D2A7234C045 for ; Tue, 27 Oct 2009 23:15:59 -0700 (PDT) Message-ID: <1579768429.1256710559358.JavaMail.jira@brutus> Date: Wed, 28 Oct 2009 06:15:59 +0000 (UTC) From: "Julius Davies (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (CODEC-89) new Base64().encode() appends a CRLF MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 new Base64().encode() appends a CRLF ------------------------------------ Key: CODEC-89 URL: https://issues.apache.org/jira/browse/CODEC-89 Project: Commons Codec Issue Type: Bug Affects Versions: 1.4 Reporter: Julius Davies new Base64().encode() appends a CRLF {code} import org.apache.commons.codec.binary.*; public class B64 { public static void main(String[] args) throws Exception { Base64 b64 = new Base64(); String s1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; String s2 = "aaaaaaaaaa"; String s3 = "a"; byte[] b1 = s1.getBytes("UTF-8"); byte[] b2 = s2.getBytes("UTF-8"); byte[] b3 = s3.getBytes("UTF-8"); byte[] result; result = Base64.encodeBase64(b1); System.out.println("[" + new String(result, "UTF-8") + "]"); result = b64.encode(b1); System.out.println("[" + new String(result, "UTF-8") + "]"); result = Base64.encodeBase64(b2); System.out.println("[" + new String(result, "UTF-8") + "]"); result = b64.encode(b2); System.out.println("[" + new String(result, "UTF-8") + "]"); result = Base64.encodeBase64(b3); System.out.println("[" + new String(result, "UTF-8") + "]"); result = b64.encode(b3); System.out.println("[" + new String(result, "UTF-8") + "]"); } } {code} Here's my output: {noformat} $ java -cp commons-codec-1.3.jar:. B64 [YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==] [YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==] [YWFhYWFhYWFhYQ==] [YWFhYWFhYWFhYQ==] [YQ==] [YQ==] $ java -cp commons-codec-1.4.jar:. B64 [YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==] [YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== ] [YWFhYWFhYWFhYQ==] [YWFhYWFhYWFhYQ== ] [YQ==] [YQ== ] {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.