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.
Follow on from #258
There's three minor cleanups here arranged into two patches so you can see the effect on utf8proc_data.c. (We might want to squash the patches together when merging because they churn utf8proc_data.c a bit due to two of them affecting the encoding tables in a non-meaningful but global way which is why I've put them all together here in this PR.)
Only one of these fixes is observable via the API as a minor bug fix for properties of U+200C and U+200D.
The patch notes:
[PATCH 1/2] Fix two minor bugs from the Ruby code
First,
categroy
rather thancode
was used in constructing thecontrol_boundary
property as related to the characters U+200C andU+200D. This seemed incorrect and should be fixed. This could be an
observable bugfix for any C code which inspects the
control_boundary
property.
Second, when reading composition exclusions, Ruby's String hex method
produces zero rather than nil if no number is found. For example
This led to the character
'\0'
being included in theexclusions
and
excl_versions
sets which is incorrect. However this seemsasymptomatic because
'\0'
is never part of a composition. (In terms ofthe C code, the use of
comp_exclusion
is guarded by thecomb_index
property which is
UINT16_MAX
for'\0'
.)[PATCH 2/2] Cleanup: Remove sequence ordering hack
This hack changed the ordering of sequences encoded in the sequences
table and was added so we could easily prove equivalence to the Ruby
data generator code.
However, it's no longer needed and removing it shouldn't result in any
functional change.