Ensure that BigGridDemo is consistent in the encoding of the XML
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1082938 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9e5f795b54
commit
21f2b84ef3
@ -39,6 +39,8 @@ import org.apache.poi.xssf.usermodel.*;
|
|||||||
* @author Yegor Kozlov
|
* @author Yegor Kozlov
|
||||||
*/
|
*/
|
||||||
public class BigGridDemo {
|
public class BigGridDemo {
|
||||||
|
private static final String XML_ENCODING = "UTF-8";
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
// Step 1. Create a template file. Setup sheets and workbook-level objects such as
|
// Step 1. Create a template file. Setup sheets and workbook-level objects such as
|
||||||
@ -58,7 +60,7 @@ public class BigGridDemo {
|
|||||||
|
|
||||||
//Step 2. Generate XML file.
|
//Step 2. Generate XML file.
|
||||||
File tmp = File.createTempFile("sheet", ".xml");
|
File tmp = File.createTempFile("sheet", ".xml");
|
||||||
Writer fw = new FileWriter(tmp);
|
Writer fw = new OutputStreamWriter(new FileOutputStream(tmp), XML_ENCODING);
|
||||||
generate(fw, styles);
|
generate(fw, styles);
|
||||||
fw.close();
|
fw.close();
|
||||||
|
|
||||||
@ -194,7 +196,7 @@ public class BigGridDemo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void beginSheet() throws IOException {
|
public void beginSheet() throws IOException {
|
||||||
_out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
|
_out.write("<?xml version=\"1.0\" encoding=\""+XML_ENCODING+"\"?>" +
|
||||||
"<worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">" );
|
"<worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">" );
|
||||||
_out.write("<sheetData>\n");
|
_out.write("<sheetData>\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user