You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/10/25 09:50:45 UTC

svn commit: r328304 - in /directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind: BindNameRule.java BindSimpleCredentialsRule.java

Author: elecharny
Date: Tue Oct 25 00:50:39 2005
New Revision: 328304

URL: http://svn.apache.org/viewcvs?rev=328304&view=rev
Log:
Fixed the way Name was encoded.

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindNameRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindSimpleCredentialsRule.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindNameRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindNameRule.java?rev=328304&r1=328303&r2=328304&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindNameRule.java (original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindNameRule.java Tue Oct 25 00:50:39 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.BindRequest;
 
 import java.nio.ByteBuffer;
@@ -55,6 +56,7 @@
         BindRequest req = ( BindRequest ) getDigester().peek() ;
 
         byte[] name = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -67,6 +69,7 @@
             buf.get( name ) ;
         }
 
-        req.setName( new String( name ) ) ;
+        // The byte array is an UTF-8 encoded String
+        req.setName( StringUtils.toUtf8( name ) ) ;
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindSimpleCredentialsRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindSimpleCredentialsRule.java?rev=328304&r1=328303&r2=328304&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindSimpleCredentialsRule.java (original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/bind/BindSimpleCredentialsRule.java Tue Oct 25 00:50:39 2005
@@ -67,6 +67,7 @@
         BindRequest req = ( BindRequest ) getDigester().peek() ;
 
         byte[] credentials = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store