properly enable in-code hex entity encoder #238
Merged
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.
Function
_write_attr_string
improperly handles the fact that signedness ofchar
is implementation- and platform-defined. Furthermore, in x86-land, the default is signed char, socur[0] >= 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 thatxmlSerializeHexCharRef
generates hex-based entities, buttest_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.