harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r776011 - /harmony/enhanced/classlib/trunk/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetDecoderTest.java
Date Mon, 18 May 2009 17:07:20 GMT
Author: odeakin
Date: Mon May 18 17:07:20 2009
New Revision: 776011

URL: http://svn.apache.org/viewvc?rev=776011&view=rev
Log:
Ensure test data is not converted to the native character set when creating the String from
the original byte array.

Modified:
    harmony/enhanced/classlib/trunk/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetDecoderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetDecoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetDecoderTest.java?rev=776011&r1=776010&r2=776011&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetDecoderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/test/java/tests/api/java/nio/charset/CharsetDecoderTest.java
Mon May 18 17:07:20 2009
@@ -795,7 +795,12 @@
             int inPosition = in.position();
             byte[] input = new byte[in.remaining()];
             in.get(input);
-            String result = new String(input);
+            String result;
+            try {
+                result = new String(input, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                throw new AssertionError(e);
+            }
             if (result.startsWith("malform")) {
                 // reset the cursor to the error position
                 in.position(inPosition);



Mime
View raw message