You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Clere, Jean-Frederic" <jf...@fujitsu.siemens.es> on 2000/03/30 18:07:05 UTC

[PATCH] EBCDIC support -Allow xml in native encoding-

I am testing Ant on a BS2000 - Siemens EBCDIC mainframe -
and have arranged the file:
jakarta-ant/src/main/org/apache/tools/ant/SunParser.java
to allow the build.xml file to be in the machine encoding.
As build.xml is source file it had to be in the native encoding!

Here after are the needed changes:

--- jakarta-ant/src/main/org/apache/tools/ant/SunParser.java	Thu Mar 30
16:44:04 2000
+++ jakarta-ant/src/main/org/apache/tools/ant/SunParser.java	Thu Mar 30
12:08:07 2000
@@ -55,6 +55,8 @@
 package org.apache.tools.ant;
 
 import java.io.File;
+import java.io.InputStreamReader;
+import java.io.FileInputStream;
 import java.io.IOException;
 import com.sun.xml.parser.Resolver;
 import com.sun.xml.tree.XmlDocument;
@@ -73,7 +75,9 @@
      */
     public Document parse(File buildFile)
     throws SAXException, IOException {
-	    InputSource input = Resolver.createInputSource(buildFile);
+	    // InputSource input = Resolver.createInputSource(buildFile);
+	    // xml = source use native encoding.
+            InputSource input = new InputSource( new InputStreamReader(new
FileInputStream(buildFile)));
 	    return XmlDocument.createXmlDocument(input, false);
     }
 }


 <<SunParser.ant.txt>> 
Jean-Frédéric Clère
EP LP DC22 (BCN)
Fujitsu Siemens Computers
Phone + 34 93 480 4209
Fax     + 34 93 480 4201
Mail mailto:jfrederic.clere@fujitsu.siemens.es