ianprime0509 / zig-xml

XML parser for Zig
http://ianjohnson.dev/zig-xml/
BSD Zero Clause License
14 stars 3 forks source link

Non-UTF-8 encoding support #37

Open ianprime0509 opened 1 week ago

ianprime0509 commented 1 week ago

This functionality was regressed in #36. It should be possible to support encodings other than UTF-8.

In the current Reader design, this is probably best implemented at the Reader.Source level (the Reader will continue to receive UTF-8-encoded data), and furthermore the assume_valid_utf8 option can be used to avoid unnecessary validation of the UTF-8 data fed to the Reader from the custom encoding Source. What is missing in the current design is a function on Source to validate the encoding declared on the document; currently Reader just rejects anything that isn't UTF-8.