Open-source Languages & Tools for z/OS

 View Only

 ANT File Encoding Issues

Roger Williams's profile image
Roger Williams posted 05-07-2025 13:49

Hello Sergei/Alexander,

Greatly appreciated the prompt replies!

I removed the "<?xml encoding" lines from all .xml and .dtd (as per Sergey);

and upgraded ANT to 1.10 (as per Alexander).

A little change - but no joy:

Buildfile: /local/vssi/dev/ptk/build.xml                                        
                                                                                
BUILD FAILED                                                                    
/local/vssi/dev/ptk/build/project.dtd:1: Invalid byte 2 of 2-byte UTF-8 sequence
.                                                                               
                                                                                
Total time: 4 seconds                                                           
DEVTEST:/local/vssi/dev/ptk: >chtag -tc ibm-1047 build/project.dtd              
DEVTEST:/local/vssi/dev/ptk: >vssant build.all                                  
Buildfile: /local/vssi/dev/ptk/build.xml                                        
                                                                                
BUILD FAILED                                                                    
/local/vssi/dev/ptk/build/project.dtd:1: Invalid byte 2 of 2-byte UTF-8 sequence
.                                                                               
                                                                                
Total time: 3 seconds                                                           
DEVTEST:/local/vssi/dev/ptk: >vssant show.system                                
Buildfile: /local/vssi/dev/ptk/build.xml                                        
                                                                                
BUILD FAILED                                                                    
/local/vssi/dev/ptk/build/project.dtd:1: Invalid byte 2 of 2-byte UTF-8 sequence

The project DTD begins like this (I didn't paste the whole thing, it's quite large):

<!ENTITY % boolean "(true|false|on|off|yes|no)">
<!ENTITY % tasks "limit | propertyfile | ccmkdir | importtypelib | vsscheckin | sql | p4reopen | cvspass | csc | inifile | dirname | wlrun | p4label | p4revert | replaceregexp | get | jjtree | sleep | jarlib-display | dependset | zip | patch | jspc | style | test | tstamp | unwar | vsshistory | icontract | sortlist | cvschangelog | runtarget | p4submit | ccmcheckin | post | p4change | bzip2 | sync | p4delete | vssadd | javadoc | p4integrate | translate | signjar | cclock | chown | vajload | jarlib-available | rexec | WsdlToDotnet | buildnumber | if | ejbjar | pathtofileset | outofdate | remoteant | war | stlist | rename | serverdeploy | sequential | property | subant | move | ildasm | copydir | trycatch | cccheckin | ccunlock | emma | wljspc | fixcrlf | antclipse | telnet | sosget | pathconvert | antserver | record | p4sync | exec | ccmklabel | p4edit | manifest | maudit | netrexxc | antlr | ftp | foreach | antfetch | execon | ant | ccmcheckout | p4resolve | xmlvalidate | xslt | native2ascii | iplanet-ejbc | ccmcheckintask | gzip | ccrmtype | starteam | ear | input | hibernatedoclet | emmajava | presetdef | rmic | checksum | mail | bool | loadfile | vsscheckout | stylebook | soscheckin | mimemail | gunzip | stlabel | concat | cab | touch | throw | switch | parallel | splash | antcall | pathtodir | ccmkbl | cccheckout | typedef | assert | urlencode | p4have | filter | import | xmlproperty | jarjar | subwcrev | copy | jsharpc | math | symlink | propertyregex | antstructure | script | ccmcreatetask | rpm | delete | attrib | replace | waitfor | untar | loadproperties | echoproperties | available | junit | stcheckin | chgrp | vajexport | stcheckout | bunzip2 | whichresource | copyfile | p4labelsync | compilewithwalls | vsscreate | antcallback | macrodef | propertyselector | cc | ejbc | unjar | vbc | shellscript | wsdltodotnet | mkdir | condition | cvs | tempfile | junitreport | ccmkattr | forget | taskdef | var | echo | ccupdate | genjar | java | renameext | vsslabel | javadoc2 | basename | for | vsscp | tar | vajimport | osfamily | p4fstat | setproxy | wlstop | p4counter | ilasm | soscheckout | apply | ccuncheckout | jarlib-resolve | stopwatch | cvstagdiff | jlink | javacc | pvcs | jarlib-manifest | chmod | ccmklbtype | jar | sound | scriptdef | defaultexcludes | mparse | blgenclient | uptodate | propertycopy | jjdoc | genkey | ccmkelem | javah | ccmreconfigure | fail | unzip | javac | p4add | soslabel | depend | timestampselector | vssget | deltree | ddcreator">
<!ENTITY % types "extensionSet | mergemapper | compiler | filterreader | selector | islessthan | propertyset | chainedmapper | dirset | regexpmapper | unpackagemapper | ispropertytrue | compositemapper | ispropertyfalse | description | flattenmapper | scriptfilter | concatfilter | xmlcatalog | extension | targetplatform | packagemapper | regexp | versioninfo | filterchain | filterset | classfileset | patternset | mapper | linker | assertions | distributer | substitution | zipfileset | libfileset | redirector | filelist | isgreaterthan | path | defineset | fileset | globmapper | identitymapper">

Again gentlemen, thank you for the prompt response - the world needs more SystemZ love!!!!


.                                                                               
                                                                                
Total time: 5 seconds                                                           
DEVTEST:/local/vssi/dev/ptk: >                                                  

Sergey Rezepin's profile image
Sergey Rezepin

Hi Roger,

The Git attributes look fine.
Do you have an encoding attribute like the following in your XML files?

<?xml version='1.0' encoding="UTF-8"?>

Ant should work well with IBM-1047 tagged files, but there's a known issue related to the encoding="UTF-8" attribute in such files:
Ant Known Issues

I recommend removing the encoding attribute, if it exists and if that's an option in your case.
 
If that doesn't help, could you please share an example of the XML or DTD file where the error occurs?


Thanks,
Sergey 

Alexander Klochkov's profile image
Alexander Klochkov

Hi ,

The latest version of the ant we currently have is 1.10.14. Can you try it with your example?
https://anaconda.org/zoss-appdev/ant/files
If the issue persists, could you please attach the xml and dtd examples and steps to reproduce the error?

Thanks,
Alexander