lxml parser should just pass-through junk characters for robustness
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
New
|
Undecided
|
Unassigned |
Bug Description
In my real-word case, I have XML files with "windows-1252" encoding. Sometimes the text body of XML elements has a bit of incorrectly encoded characters and the parser converts these to XML numeric entities. The parser should just pass-through such text-body strings, or have an option to allow that.
However, the lxml parser converts the junk characters into numeric XML entities, which may be good for some situations, but not mine. Note that "xmllint --format sample.xml" passes through without converting to numeric entities.
Specifically:
?xml version="1.0" encoding=
<ROOT>
<SNM>
</ROOT>
Should NOT result in:
<?xml version="1.0" encoding="ASCII"?>
<ROOT>
<SNM>
</ROOT>
Script to reproduce is attached.