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.
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 theReader.Source
level (theReader
will continue to receive UTF-8-encoded data), and furthermore theassume_valid_utf8
option can be used to avoid unnecessary validation of the UTF-8 data fed to theReader
from the custom encodingSource
. What is missing in the current design is a function onSource
to validate the encoding declared on the document; currentlyReader
just rejects anything that isn't UTF-8.