externalEncoding for UTF-8 outfile
Brought to you by:
dkuhlman
Hi,
Thank you for developing this package.
I believed I've discovered an error when generating classes from the XSD.
Converting XSDs containing special characters like ô would result in character encoding issues in outfile.py
.
I was calling the script with the following parameters:
python venv\Scripts\genrateDS.py -o output.py --external-encoding utf-8 xsd_file.xml,
The error was fixed by changing line 9558 in generateDS.py
from
outfile = open(outfileName, "a")
to
outfile = open(outfileName, "a", encoding = ExternalEncoding)
Thus in my case allowing for correct encoding of output.py
.
I'm not sure if this change will break the script in other applications, but I have not encountered any errors from it so far.