Warning
This post was published 53 days ago. The information described in this article may have changed.
Chars().count() return different value depending on normalization
โ rust ๐ 2025-05-09 ๐ค surdeus ๐๏ธ 7chars().count()
is supposed to return the number of characters in a Unicode string.
I found out that depending on unicode normalization forms, it is not always the case.
See Rust Playground
I get accents as separate characters.
Is this on purpose ? (if so why??)
How do I always get a consistent count of 8 characters for the "kรฉrosรจne"
string ?
2 posts - 2 participants
๐ท๏ธ rust_feed