Add simdutf_utf8_length_from_utf32 to C API#937
Merged
lemire merged 1 commit intosimdutf:masterfrom Feb 12, 2026
Merged
Conversation
triallax
commented
Feb 8, 2026
| } | ||
| size_t simdutf_utf8_length_from_utf32(const char32_t *input, size_t length) { | ||
| return simdutf::utf8_length_from_utf32( | ||
| reinterpret_cast<const char32_t *>(input), length); |
Contributor
Author
There was a problem hiding this comment.
I added this cast here because it's used in some other functions like simdutf_utf8_length_from_utf16_with_replacement, but I wonder if it's really necessary? In both this and the other functions the cast is to the same type of input so it seems unnecessary to me
Collaborator
There was a problem hiding this comment.
I think the original code was made with AI.
I agree this is unnecessary, please remove it (and at the other places too, if you have time).
35bca9c to
366bf35
Compare
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.
Short title (summary): Add
simdutf_utf8_length_from_utf32to C APIDescription
Added
simdutf_utf8_length_from_utf32to the C API, it appears to have been missed when the header was introducedType of change
Checklist before submitting
Don't think adding a test is necessary as this is a simple wrapper
Don't think this is needed
None