aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
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/examples
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/examples')
-rw-r--r--src/examples/src/org/apache/poi/hwpf/Word2Forrest.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/examples/src/org/apache/poi/hwpf/Word2Forrest.java b/src/examples/src/org/apache/poi/hwpf/Word2Forrest.java
index 0b8570226a..4561851ca9 100644
--- a/src/examples/src/org/apache/poi/hwpf/Word2Forrest.java
+++ b/src/examples/src/org/apache/poi/hwpf/Word2Forrest.java
@@ -22,8 +22,8 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
import java.io.Writer;
+import java.nio.charset.Charset;
import org.apache.poi.hwpf.model.StyleDescription;
import org.apache.poi.hwpf.model.StyleSheet;
@@ -37,10 +37,9 @@ public final class Word2Forrest
HWPFDocument _doc;
@SuppressWarnings("unused")
- public Word2Forrest(HWPFDocument doc, OutputStream stream)
- throws IOException, UnsupportedEncodingException
+ public Word2Forrest(HWPFDocument doc, OutputStream stream) throws IOException
{
- OutputStreamWriter out = new OutputStreamWriter (stream, "UTF-8");
+ OutputStreamWriter out = new OutputStreamWriter (stream, Charset.forName("UTF-8"));
_out = out;
_doc = doc;