Apache Directory Project - [jira] Created: (DIRSERVER-1009) ASN.1 decoder does not use UTF-8

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > July 2007 > [jira] Created: (DIRSERVER-1009) ASN.1 decoder does not use UTF-8





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: (DIRSERVER-1009) ASN.1 decoder does not use UTF-8
Klemen Zagar (JIRA)

2007-07-25, 1:11 pm

ASN.1 decoder does not use UTF-8 encoding for strings
-----------------------------------------------------

Key: DIRSERVER-1009
URL: https://issues.apache.org/jira/browse/DIRSERVER-1009
Project: Directory ApacheDS
Issue Type: Bug
Components: asn1
Affects Versions: 1.5.0
Environment: JDK 1.6, WinXP
Reporter: Klemen Zagar


Currently, LDAP ASN.1 decoder transforms byte[] to String via calls such as:

String any = new String( tlv.getValue().getData() );
(source: /ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java, line 74)

This uses some default encoding, though according to LDAP RFC, UTF-8 should always be used (http://www.rfc-editor.org/rfc/rfc2251.txt, section 4.1.2).

I recommend that the following code be used for converting byte[] to String:

// static variable containing the UTF8 encoder
private static final Charset UTF8 = Charset.forName("UTF8");

// wherever byte[]->string conversion is needed
String any = UTF8.decode(tlv.getValue().getData()).toString();

From user's perspective, the problem is that non-ASCII characters in search filters are messed up, and search doesn't return any results.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com