Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EEE499C63 for ; Fri, 6 Apr 2012 07:51:01 +0000 (UTC) Received: (qmail 18916 invoked by uid 500); 6 Apr 2012 07:51:01 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 18605 invoked by uid 500); 6 Apr 2012 07:50:57 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 18564 invoked by uid 99); 6 Apr 2012 07:50:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 07:50:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 07:50:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8082235B929 for ; Fri, 6 Apr 2012 07:50:30 +0000 (UTC) Date: Fri, 6 Apr 2012 07:50:30 +0000 (UTC) From: "Emmanuel Lecharny (Commented) (JIRA)" To: dev@directory.apache.org Message-ID: <812037674.22478.1333698630641.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <984155628.17965.1333646186476.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DIRSTUDIO-802) confusion between ISO-8859-1 and UTF-8 in the encode/decode LDAP gui tool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIRSTUDIO-802?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1= 3248162#comment-13248162 ]=20 Emmanuel Lecharny commented on DIRSTUDIO-802: --------------------------------------------- Here is what I get when I use this snippet of code : @Test public void testUtf8Base64() throws UnsupportedEncodingException { String name =3D new String( "herv\u00e9" ); // Herv=C3=A9 in Unicod= e byte[] utf8 =3D Strings.getBytesUtf8( name ); =20 System.out.println( Strings.dumpBytes( utf8 ) ); =20 String utf8Base64 =3D new String( Base64.encode( utf8 ) ); =20 System.out.println( "Herv\u00e9 utf-8 base 64 encoded : " + utf8Bas= e64 ); =20 byte[] iso8859 =3D name.getBytes( "ISO-8859-1" ); System.out.println( Strings.dumpBytes( iso8859 ) ); String iso8859Base64 =3D new String( Base64.encode( iso8859 ) ); =20 System.out.println( "Herv\u00e9 ISO-8859-1 base 64 encoded : " + is= o8859Base64 ); } produces : 0x68 0x65 0x72 0x76 0xC3 0xA9=20 Herv=C3=A9 utf-8 base 64 encoded : aGVydsOp 0x68 0x65 0x72 0x76 0xE9=20 Herv=C3=A9 ISO-8859-1 base 64 encoded : aGVyduk=3D =20 > confusion between ISO-8859-1 and UTF-8 in the encode/decode LDAP gui tool > ------------------------------------------------------------------------- > > Key: DIRSTUDIO-802 > URL: https://issues.apache.org/jira/browse/DIRSTUDIO-802 > Project: Directory Studio > Issue Type: Bug > Affects Versions: 1.5.3 > Environment: Windows XP pro > Reporter: julien2512 > Priority: Minor > Labels: decode, encode, iso-8859-1, utf8 > Attachments: encode-decode LDAP demo 1.PNG, encode-decode LDAP de= mo 2.PNG > > Original Estimate: 1h > Remaining Estimate: 1h > > The encode/decode tool (from the LDAP menu) gives "aGVydsOp" for BASE-64 = encoding from the ISO-8859-1 string "herv=C3=A9". > while the website http://www.base64decode.org/ gives the same results f= rom the same string but in UTF-8. > Also UTF-8 BASE 64 encoding of Apache Directory Studio match with ISO-885= 9-1 BASE64 encoding of the previous website. > The result from my own java code match with that website. > I think there is a confusion between ISO-8859-1 and UTF-8 in the encode/d= ecode LDAP gui tool of Apache Directory Studio. > It will be easy to fix. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira