Repository navigation
[3.x] Fix parsing a UTF-8 file without BOM that declares ISO-8859-1 - #384
Merged
Merged
Conversation
* do not try to discover the encoding used when the input is given a Reader * simplified test-encoding-ISO-8859-1.xml test file * fixed tests exercising encoding checks. Unsupported tests were skipped --------- Co-authored-by: Gabriel Belingueres <belingueres@gmail.com> (cherry picked from commit 300a4e4) (cherry picked from commit 809231ce3963db1bf5ae3cd6bf1da509c622d5ea)
slachiewicz
marked this pull request as ready for review
December 1, 2026 12:29
gnodet
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the error from #242 on the 3.x line: a UTF-8 file without a BOM that declares
ISO-8859-1failed with "UTF-8 BOM plus xml decl of ISO-8859-1 is incompatible" when the parser was given aReader. The fix went into plexus-xml (codehaus-plexus/plexus-xml#1) when the XML classes moved there; 3.x bundles its own copy and never received it.The commit is @gnodet's and @belingueres's, cherry-picked as authored; the conflicts were the
ReaderFactorypackage and test formatting. Please merge with "Rebase and merge" so their authorship is kept.As in plexus-xml,
setInput(InputStream, null)now reads the stream strictly: a BOM that contradicts the XML declaration is rejected instead of tolerated.Verified:
mvn clean verify→ 482 tests, 0 failures; with the unpatchedMXParserandXmlReaderthe ported tests fail (5 failures, two with the message above).