Function _write_attr_string improperly handles the fact that signedness of char is implementation- and platform-defined. Furthermore, in x86-land, the default is signed char, so cur >= 0x80 is always false and the whole branch is dead code.
That means that function xmlSerializeHexCharRef never actually executed and the encoding was happening magically inside libxml. (This is evidenced by the fact that xmlSerializeHexCharRef generates hex-based entities, but test_attribute_quoting_unicode was checking for decimal-based encoding. With that said, I'm very curious if commit 7eef158 ever actually did anything?)
This PR forces using unsigned chars where appropriate, fixes incorrect xmlOutputBufferWrite call, and updates the testcase to test for hex-based encoding.
The text was updated successfully, but these errors were encountered:
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.