Menu

#39 externalEncoding for UTF-8 outfile

1.0
open
2023-08-14
2023-08-14
No

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.pyfrom

            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.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.