On 28/05/2014 10:46, Aravinda VK wrote:
Thanks. I didn't know about char_len.
`unicode_str.as_slice().char_len()` is giving number of code points.

Sorry for the confusion, I was referring codepoint as character in my
mail. char_len gives the correct output for my requirement. I have
written javascript script to convert from string length to grapheme
cluster length for Kannada language.

Be careful, JavaScript’s String.length counts UCS-2 code units, not code points…

--
Simon Sapin
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to