harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r793617 - /harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
Date Mon, 13 Jul 2009 16:28:07 GMT
Author: odeakin
Date: Mon Jul 13 16:28:07 2009
New Revision: 793617

URL: http://svn.apache.org/viewvc?rev=793617&view=rev
Log:
Make sure the getBytes() does not use the native encoding for EBCDIC platforms.

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java?rev=793617&r1=793616&r2=793617&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
Mon Jul 13 16:28:07 2009
@@ -23,6 +23,7 @@
 package org.apache.harmony.security.asn1;
 
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.text.SimpleDateFormat;
 import java.util.TimeZone;
 
@@ -111,7 +112,13 @@
         if (temp.charAt(currLength) == '.') {
             temp = temp.substring(0, currLength);
         }
-        out.content = (temp + "Z").getBytes(); //$NON-NLS-1$
+
+        try {
+            out.content = (temp + "Z").getBytes("UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e.getMessage());
+        }
+        
         out.length = ((byte[]) out.content).length;
     }
 }
\ No newline at end of file



Mime
View raw message