diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2014-12-27 01:33:28 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2014-12-27 01:33:28 +0000 |
commit | b91e4800060c9d1748007d921b60e36c62e2377e (patch) | |
tree | 84fff9e96a17cf25c7f67cdbc442a78cce06ecf9 /src/testcases/org/apache | |
parent | 70d7ec0e693a2de9a7c6540e2fec300b756ecccc (diff) | |
download | poi-b91e4800060c9d1748007d921b60e36c62e2377e.tar.gz poi-b91e4800060c9d1748007d921b60e36c62e2377e.zip |
Charset.forName() for known encodings makes catching UnknownEncodingException obsolete
Unify UTF-16LE conversion to StringUtil
BugFix for RecordInputStream.readFully in combination with continuing records
BugFix for integration tests - fix pathname for handler/exclude lookup on windows
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1648032 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache')
-rw-r--r-- | src/testcases/org/apache/poi/util/TestStringUtil.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/testcases/org/apache/poi/util/TestStringUtil.java b/src/testcases/org/apache/poi/util/TestStringUtil.java index 4f85929bd2..04c03d93e8 100644 --- a/src/testcases/org/apache/poi/util/TestStringUtil.java +++ b/src/testcases/org/apache/poi/util/TestStringUtil.java @@ -17,13 +17,13 @@ package org.apache.poi.util; -import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; import java.text.NumberFormat; -import org.apache.poi.util.StringUtil.StringsIterator; - import junit.framework.TestCase; +import org.apache.poi.util.StringUtil.StringsIterator; + /** * Unit test for StringUtil * @@ -61,12 +61,7 @@ public final class TestStringUtil extends TestCase { (byte) 'o', (byte) ' ', (byte) 'W', (byte) 'o', (byte) 'r', (byte) 'l', (byte) 'd', (byte) 0xAE }; - String input; - try { - input = new String( expected_output, StringUtil.getPreferredEncoding() ); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } + String input = new String( expected_output, Charset.forName(StringUtil.getPreferredEncoding()) ); StringUtil.putCompressedUnicode( input, output, 0 ); for ( int j = 0; j < expected_output.length; j++ ) |