aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-07-15 21:52:32 +0000
committerPJ Fanning <fanningpj@apache.org>2022-07-15 21:52:32 +0000
commit87ee700d04af1fea764c0762f0fb5dada4411295 (patch)
treefadbb626410244764c087b4ed23cc467eed76764 /poi
parent70bd85fda41f885427e3db8d5b32eb71656f8eb0 (diff)
downloadpoi-87ee700d04af1fea764c0762f0fb5dada4411295.tar.gz
poi-87ee700d04af1fea764c0762f0fb5dada4411295.zip
[github-340] make more use of StandardCharsets. Thanks to XenoAmess. This closes #340
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902755 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r--poi/src/test/java/org/apache/poi/ss/formula/function/ExcelCetabFunctionExtractor.java2
-rw-r--r--poi/src/test/java/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java3
2 files changed, 3 insertions, 2 deletions
diff --git a/poi/src/test/java/org/apache/poi/ss/formula/function/ExcelCetabFunctionExtractor.java b/poi/src/test/java/org/apache/poi/ss/formula/function/ExcelCetabFunctionExtractor.java
index 5362f406cd..8cee4a828c 100644
--- a/poi/src/test/java/org/apache/poi/ss/formula/function/ExcelCetabFunctionExtractor.java
+++ b/poi/src/test/java/org/apache/poi/ss/formula/function/ExcelCetabFunctionExtractor.java
@@ -322,7 +322,7 @@ public final class ExcelCetabFunctionExtractor {
private static void processFile(InputStream input, File outFile) throws IOException {
try (OutputStream os = new SimpleAsciiOutputStream(new FileOutputStream(outFile));
- PrintStream ps = new PrintStream(os, true, "UTF-8")) {
+ PrintStream ps = new PrintStream(os, true, StandardCharsets.UTF_8.name())) {
outputLicenseHeader(ps);
Class<?> genClass = ExcelCetabFunctionExtractor.class;
diff --git a/poi/src/test/java/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java b/poi/src/test/java/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java
index 3e7c1ab2a2..6e5f0645df 100644
--- a/poi/src/test/java/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java
+++ b/poi/src/test/java/org/apache/poi/ss/formula/function/ExcelFileFormatDocFunctionExtractor.java
@@ -30,6 +30,7 @@ import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
+import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Arrays;
@@ -492,7 +493,7 @@ public final class ExcelFileFormatDocFunctionExtractor {
os = new SimpleAsciiOutputStream(os);
PrintStream ps;
try {
- ps = new PrintStream(os, true, "UTF-8");
+ ps = new PrintStream(os, true, StandardCharsets.UTF_8.name());
} catch(UnsupportedEncodingException e) {
throw new RuntimeException(e);
}