Chars().count() return different value depending on normalization

โš“ rust    ๐Ÿ“… 2025-05-09    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 2      

surdeus

chars().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

Read full topic

๐Ÿท๏ธ rust_feed