Skip to content

fix: letter_of for Unicode strings#287

Closed
b-fein wants to merge 1 commit into
aspizu:mainfrom
b-fein:fix-letter-of-unicode
Closed

fix: letter_of for Unicode strings#287
b-fein wants to merge 1 commit into
aspizu:mainfrom
b-fein:fix-letter-of-unicode

Conversation

@b-fein
Copy link
Copy Markdown
Contributor

@b-fein b-fein commented May 21, 2026

Fixes #286

The problem was that str.len() returns the number of bytes in the string rather than the number of characters. Since Unicode characters can have multiple bytes, we cannot assume that number of bytes = number of characters.

@aspizu
Copy link
Copy Markdown
Owner

aspizu commented May 22, 2026

thanks

@aspizu aspizu closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Option::None unwrap when out-of-bounds indexing non-ascii strings (letter-of block)

2 participants