Il giorno sabato 23 luglio 2016 16:52:29 UTC+2, T L ha scritto:
>
> len(str) will get the count of bytes.
>
> utf8.RuneCountInString(str) will get the count of runes.
>
> but how to get the count of characters?
>

The term "character" may be used to refer to a "grapheme cluster".

How to find grapheme cluster boundaries is described in
http://unicode.org/reports/tr29/
but the algorithm is not (yet?) implemented in the golang.org/x/text package


Manlio 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to