Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 42310 invoked from network); 26 Sep 2005 22:29:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Sep 2005 22:29:14 -0000 Received: (qmail 47513 invoked by uid 500); 26 Sep 2005 22:29:12 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 47342 invoked by uid 500); 26 Sep 2005 22:29:11 -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 47329 invoked by uid 99); 26 Sep 2005 22:29:11 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_FAIL 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; Mon, 26 Sep 2005 15:29:10 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id CE9D7123 for ; Tue, 27 Sep 2005 00:28:48 +0200 (CEST) Message-ID: <2080112646.1127773728843.JavaMail.jira@ajax.apache.org> Date: Tue, 27 Sep 2005 00:28:48 +0200 (CEST) From: =?UTF-8?Q?J=C3=A9r=C3=B4me_Baumgarten_=28JIRA=29?= To: dev@directory.apache.org Subject: [jira] Commented: (DIRSNICKERS-110) [TWIX] encoding : missing accents In-Reply-To: <1022774574.1127773552353.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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/DIRSNICKERS-110?page=3Dcomments#= action_12330523 ]=20 J=C3=A9r=C3=B4me Baumgarten commented on DIRSNICKERS-110: ----------------------------------------------- The ? in my first line should have been the kind of capital B german people= have (I guess Stefan sees what I mean). > [TWIX] encoding : missing accents > --------------------------------- > > Key: DIRSNICKERS-110 > URL: http://issues.apache.org/jira/browse/DIRSNICKERS-110 > Project: Directory ASN1 > Type: Bug > Components: BER Runtime > Reporter: J=C3=A9r=C3=B4me Baumgarten > Assignee: Alex Karasulu > > It seems there are problems when encoding accents (I believe it is same w= ith exotic characters like ?). > In TwixTransformer, private LdapResult transformLdapResult(LdapResultImpl= snickersLdapResult), > I think that line 729 shoud be > twixLdapResult.setErrorMessage( new LdapString( snickersLdapResult.getErr= orMessage().getBytes("UTF-8") ) ); > an error message can contain accents (or at least that's what I think, I = haven't checked with the RFC, it's getting kinda late here in Paris). > Line 753 should be > twixLdapResult.setMatchedDN( new LdapDN( snickersLdapResult.getMatchedDn(= ).getBytes("UTF-8") ) ); > Line 780 should be > LdapURL ldapUrl =3D new LdapURL( referral.getBytes("UTF-8") ); > In TwixTransformer, private void transformSearchResultEntry( LdapMessage = twixMessage, Message snickersMessage ) > Line 977 should be (a DN can definitely contain accents) > searchResultEntry.setObjectName( new LdapDN( snickersSearchResultResponse= .getObjectName().getBytes("UTF-8") ) ); > SearchResultEntry, public int computeLength() does take into account the = fact that the the string value(s) of the attribute will be encoded as UTF-8= in Value.encode(ByteBuffer buffer, String string). So if the value contain= s characters coded on 2 bytes, there will be an EncoderException saying tha= t the PDU buffer size is too small. Also, according to a mail exchange I ha= d with Emmanuel, there also is another mistake in the length computation, i= t should be something like : > byte[] bytes =3D stringValue.getBytes( "UTF-8" ); > localValuesLength +=3D 1 + Length.getNbBytes( bytes.length ) + > bytes.length; > Jerome --=20 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