From c58e6f00c0c8aa4870979a07ebff727bbc8eb078 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 27 Feb 2011 00:07:26 -0500 Subject: [PATCH] Fix inconsistency in packout - the xml file encoding property is defined as ISO-8859-1 but the file stream is written with utf-8. I had problems importing the generated files, all accents and special characters were imported wrongly. --- org.adempiere.pipo.legacy/src/org/adempiere/pipo/PackOut.java | 4 ++-- org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.adempiere.pipo.legacy/src/org/adempiere/pipo/PackOut.java b/org.adempiere.pipo.legacy/src/org/adempiere/pipo/PackOut.java index 61b12e8274..c1e8067eee 100644 --- a/org.adempiere.pipo.legacy/src/org/adempiere/pipo/PackOut.java +++ b/org.adempiere.pipo.legacy/src/org/adempiere/pipo/PackOut.java @@ -173,7 +173,7 @@ public class PackOut extends SvrProcess boolean success = (new File(packagename+File.separator+"doc"+File.separator)).mkdirs(); String file_document = packagename+File.separator+"doc"+File.separator+rs1.getString(X_AD_Package_Exp.COLUMNNAME_Name)+"Doc.xml"; packageDocStream = new FileOutputStream (file_document, false); - StreamResult streamResult_document = new StreamResult(new OutputStreamWriter(packageDocStream,"utf-8")); + StreamResult streamResult_document = new StreamResult(new OutputStreamWriter(packageDocStream,"ISO-8859-1")); SAXTransformerFactory tf_document = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); tf_document.setAttribute("indent-number", new Integer(4)); TransformerHandler packageDocument = tf_document.newTransformerHandler(); @@ -246,7 +246,7 @@ public class PackOut extends SvrProcess success = (new File(packagename+File.separator+ "dict"+File.separator)).mkdirs(); String file_menu = packagename+File.separator+ "dict"+File.separator+"PackOut.xml"; packOutDocStream = new FileOutputStream (file_menu, false); - StreamResult streamResult_menu = new StreamResult(new OutputStreamWriter(packOutDocStream,"utf-8")); + StreamResult streamResult_menu = new StreamResult(new OutputStreamWriter(packOutDocStream,"ISO-8859-1")); SAXTransformerFactory tf_menu = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); tf_menu.setAttribute("indent-number", new Integer(4)); TransformerHandler packOutDocument = tf_menu.newTransformerHandler(); diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java index fadb490fbb..e31ce36af6 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java @@ -190,7 +190,7 @@ public class PackOut private TransformerHandler createPackoutHandler( OutputStream packoutStream) throws UnsupportedEncodingException, TransformerConfigurationException, SAXException { - StreamResult packoutStreamResult = new StreamResult(new OutputStreamWriter(packoutStream,"utf-8")); + StreamResult packoutStreamResult = new StreamResult(new OutputStreamWriter(packoutStream,"ISO-8859-1")); SAXTransformerFactory packoutFactory = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); packoutFactory.setAttribute("indent-number", new Integer(4)); TransformerHandler packoutHandler = packoutFactory.newTransformerHandler(); @@ -229,7 +229,7 @@ public class PackOut } private TransformerHandler createDocHandler(OutputStream docStream) throws UnsupportedEncodingException, TransformerConfigurationException, SAXException { - StreamResult docStreamResult = new StreamResult(new OutputStreamWriter(docStream,"utf-8")); + StreamResult docStreamResult = new StreamResult(new OutputStreamWriter(docStream,"ISO-8859-1")); SAXTransformerFactory transformerFactory = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); transformerFactory.setAttribute("indent-number", new Integer(4)); TransformerHandler docHandler = transformerFactory.newTransformerHandler();