gagolews / stringi

Fast and portable character string processing in R (with the Unicode ICU)
https://stringi.gagolewski.com/
Other
304 stars 44 forks source link

nchar now handles NAs properly, doc doesn't reflect this #310

Closed moodymudskipper closed 6 years ago

moodymudskipper commented 6 years ago

from ?stri_isempty

Missing values are handled properly, as opposed to the built-in nzchar function.

from ?stri_numbytes

Missing values are handled properly, as opposed to the built-in nchar(str, "bytes") function call

from ?stri_length

Missing values are handled properly, as opposed to the built-in nchar function. For ‘byte‘ encodings we get, as usual, an error.

from ?stri_width's examples :

nchar(stri_trans_nfkd("\u0105"), "width") # provides incorrect information
stri_width(stri_trans_nfkd("\u0105"))

Though they return the same.

gagolews commented 6 years ago

Thanks for pointing this out.