aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/openxml4j
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2014-12-27 01:33:28 +0000
committerAndreas Beeker <kiwiwings@apache.org>2014-12-27 01:33:28 +0000
commitb91e4800060c9d1748007d921b60e36c62e2377e (patch)
tree84fff9e96a17cf25c7f67cdbc442a78cce06ecf9 /src/ooxml/java/org/apache/poi/openxml4j
parent70d7ec0e693a2de9a7c6540e2fec300b756ecccc (diff)
downloadpoi-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/ooxml/java/org/apache/poi/openxml4j')
-rw-r--r--src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java
index 6385124b3f..1772fad1c2 100644
--- a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java
+++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java
@@ -20,7 +20,7 @@ package org.apache.poi.openxml4j.opc;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
import java.util.regex.Pattern;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@@ -748,13 +748,7 @@ public final class PackagingURIHelper {
int n = s.length();
if (n == 0) return s;
- ByteBuffer bb;
- try {
- bb = ByteBuffer.wrap(s.getBytes("UTF-8"));
- } catch (UnsupportedEncodingException e){
- // should not happen
- throw new RuntimeException(e);
- }
+ ByteBuffer bb = ByteBuffer.wrap(s.getBytes(Charset.forName("UTF-8")));
StringBuilder sb = new StringBuilder();
while (bb.hasRemaining()) {
int b = bb.get() & 0xff;