Rust's .len() on string does not give you the length in characters, it gives you the length in bytes. If you want the length in unicode codepoints, you need to do .chars().count(), but given things like combining characters, that might not be quite what you want either.