directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r224569 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/primitives/OctetString.java
Date Sat, 23 Jul 2005 22:51:24 GMT
Author: elecharny
Date: Sat Jul 23 15:51:21 2005
New Revision: 224569

URL: http://svn.apache.org/viewcvs?rev=224569&view=rev
Log:
Changed the toString method which now returns readable strings, or replace not readable chars
by escaped sequences
like 0x1B... 

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/primitives/OctetString.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/primitives/OctetString.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/primitives/OctetString.java?rev=224569&r1=224568&r2=224569&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/primitives/OctetString.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/primitives/OctetString.java
Sat Jul 23 15:51:21 2005
@@ -199,7 +199,14 @@
 
         for ( int i = 0; i < length; i++ )
         {
-            sb.append( StringUtils.dumpByte( bytes[i] ) );
+            if ( ( bytes[i] < 32 ) || ( bytes[i] > 127 ) ) 
+            {
+                sb.append( StringUtils.dumpByte( bytes[i] ) );
+            }
+            else
+            {
+                sb.append( (char)bytes[i] );
+            }
         }
 
         return sb.toString();



Mime
View raw message