Apache Directory Project - [jira] Created: (DIRSNICKERS-110) [TWIX] encoding : missing accents

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > September 2005 > [jira] Created: (DIRSNICKERS-110) [TWIX] encoding : missing accents





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [jira] Created: (DIRSNICKERS-110) [TWIX] encoding : missing accents
Jérôme Baumgarten (JIRA)

2005-09-26, 5:45 pm

[TWIX] encoding : missing accents
---------------------------------

Key: DIRSNICKERS-110
URL: http://issues.apache.org/jira/browse/DIRSNICKERS-110
Project: Directory ASN1
Type: Bug
Components: BER Runtime =20
Reporter: J=C3=A9r=C3=B4me Baumgarten
Assigned to: Alex Karasulu=20


It seems there are problems when encoding accents (I believe it is same wit=
h exotic characters like =CE=B2).

In TwixTransformer, private LdapResult transformLdapResult(LdapResultImpl s=
nickersLdapResult),

I think that line 729 shoud be
twixLdapResult.setErrorMessage( new LdapString( snickersLdapResult.getError=
Message().getBytes("UTF-8") ) );
an error message can contain accents (or at least that's what I think, I ha=
ven'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 tw=
ixMessage, Message snickersMessage )

Line 977 should be (a DN can definitely contain accents)
searchResultEntry.setObjectName( new LdapDN( snickersSearchResultResponse.g=
etObjectName().getBytes("UTF-8") ) );

SearchResultEntry, public int computeLength() does take into account the fa=
ct that the the string value(s) of the attribute will be encoded as UTF-8 i=
n Value.encode(ByteBuffer buffer, String string). So if the value contains =
characters coded on 2 bytes, there will be an EncoderException saying that =
the PDU buffer size is too small. Also, according to a mail exchange I had =
with Emmanuel, there also is another mistake in the length computation, it =
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/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com