directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r328513 - /directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/rules/Octets2StringRule.java
Date Wed, 26 Oct 2005 00:26:07 GMT
Author: elecharny
Date: Tue Oct 25 17:26:02 2005
New Revision: 328513

URL: http://svn.apache.org/viewcvs?rev=328513&view=rev
Log:
Fixed : the String is now UTF-8 encoded

Modified:
    directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/rules/Octets2StringRule.java

Modified: directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/rules/Octets2StringRule.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/rules/Octets2StringRule.java?rev=328513&r1=328512&r2=328513&view=diff
==============================================================================
--- directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/rules/Octets2StringRule.java
(original)
+++ directory/asn1/branches/asn1-utf8/ber/src/java/org/apache/asn1/ber/digester/rules/Octets2StringRule.java
Tue Oct 25 17:26:02 2005
@@ -20,6 +20,7 @@
 import java.nio.ByteBuffer;
 
 import org.apache.asn1.ber.TagEnum;
+import org.apache.asn1new.util.StringUtils;
 
 
 /**
@@ -54,6 +55,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -66,6 +68,6 @@
             buf.get( octets ) ;
         }
 
-        getDigester().push( new String( octets ) ) ;
+        getDigester().push( StringUtils.toUtf8( octets ) ) ;
     }
 }



Mime
View raw message