harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r658298 - in /harmony/enhanced/classlib/trunk/modules: imageio/src/test/java/javax/imageio/stream/ImageInputStreamImplTest.java security/src/main/java/common/org/apache/harmony/security/asn1/ASN1StringType.java
Date Tue, 20 May 2008 15:52:37 GMT
Author: odeakin
Date: Tue May 20 08:52:36 2008
New Revision: 658298

URL: http://svn.apache.org/viewvc?rev=658298&view=rev
Log:
ensure non-ASCII platforms use the correct encoding.

Modified:
    harmony/enhanced/classlib/trunk/modules/imageio/src/test/java/javax/imageio/stream/ImageInputStreamImplTest.java
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1StringType.java

Modified: harmony/enhanced/classlib/trunk/modules/imageio/src/test/java/javax/imageio/stream/ImageInputStreamImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/imageio/src/test/java/javax/imageio/stream/ImageInputStreamImplTest.java?rev=658298&r1=658297&r2=658298&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/imageio/src/test/java/javax/imageio/stream/ImageInputStreamImplTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/imageio/src/test/java/javax/imageio/stream/ImageInputStreamImplTest.java
Tue May 20 08:52:36 2008
@@ -26,7 +26,7 @@
 
 	public void testReadLine() throws IOException {
 		final ImageInputStream in = new BasicImageInputStreamImpl(
-				"line1\nline2\rline3\r\nline4".getBytes());
+				"line1\nline2\rline3\r\nline4".getBytes("ISO8859_1"));
 
 		assertEquals("line1", in.readLine());
 		assertEquals("line2", in.readLine());

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1StringType.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1StringType.java?rev=658298&r1=658297&r2=658298&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1StringType.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1StringType.java
Tue May 20 08:52:36 2008
@@ -118,7 +118,9 @@
      * @return java.land.String object
      */
     public Object getDecodedObject(BerInputStream in) throws IOException {
-        return new String(in.buffer, in.contentOffset, in.length);
+        /* To ensure we get the correct encoding on non-ASCII platforms, specify
+           that we wish to convert from ASCII to the default platform encoding */
+        return new String(in.buffer, in.contentOffset, in.length, "ISO-8859-1");
     }
 
     //



Mime
View raw message