From 3e8ff0141ad30a34b4092b02572e05620dff0314 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sat, 22 Mar 2014 20:48:58 +0000 Subject: [PATCH] Patch for #55594 from Paul Vonnahme - Fix SXSSF encodings on EBC IDIC platforms, by setting the required encoding explicitly git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1580314 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java | 2 +- .../java/org/apache/poi/xssf/streaming/SheetDataWriter.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java b/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java index 4008940c80..dbe7c12a31 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java @@ -60,7 +60,7 @@ public class GZIPSheetDataWriter extends SheetDataWriter { */ @Override public Writer createWriter(File fd)throws IOException { - return new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(fd))); + return new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(fd)), "UTF-8"); } diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java index 95f8f515ab..fbdda65436 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java @@ -22,9 +22,10 @@ package org.apache.poi.xssf.streaming; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; -import java.io.FileWriter; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStreamWriter; import java.io.Writer; import java.util.Iterator; @@ -84,7 +85,7 @@ public class SheetDataWriter { * @param fd the file to write to */ public Writer createWriter(File fd)throws IOException { - return new BufferedWriter(new FileWriter(fd)); + return new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fd), "UTF-8")); } /** -- 2.39.5