fix bug in utf8_length_from_utf16() on big endian #884
+28
−2
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.
there was a bug introduced in version 7.7.0 https://github.com/simdutf/simdutf/pull/863/files#diff-d1273109039f1fb5e518645f4a1560e70c431b5dab1f8ace04ed6852f1dc3f6aR2161-R2169
the bug only matters when all of these conditions are met:
utf8_length_from_utf16be_with_replacement()would give another answer thanutf8_length_from_utf16be()(requires invalid input)the api guarantee for utf8_length_from_utf16be() is: (quoting from the documentation)
this is strictly speaking not wrong.
the test added in this PR fails when running on s390x (big endian), but succeeds with the bug fix applied.