[R] How to get the length of an UTF-8 string

Fán Lóng foylong at gmail.com
Thu Nov 6 11:34:38 CET 2008


Hi there,

I am intending to get the length of an UTF-8 string which contains
some Japanese characters (let's say, rstr) in R language.
I try to use the nchar(rstr) to get its length, however, it returns
the "NA" for it contains some multi-byte characters.

Is there any alternatives to return the length of this rstr?

Any suggestion is  appreciated.

Long



More information about the R-help mailing list