ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clere, Jean-Frederic" <jfrederic.cl...@fujitsu.siemens.es>
Subject [PATCH] EBCDIC support -Allow xml in native encoding-
Date Thu, 30 Mar 2000 16:07:05 GMT
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


Mime
View raw message