Can you guess why this width is 0?
nchar("é", type = "width")
## [1] 0
This character is not é(U+00E9), but e(U+0065) + ́(U+0301).
The characters like ́(U+0301) are called combining characters. nchar() treats their width as -1.
nchar("́", type = "width")
## [1] -1
We may face these differences when using unicode normalization
char <- "\u00E9"
char
## [1] "é"
char_nfkc <- stringi::stri_trans_nfkc(char) # \u00E9
nchar(char_nfkc, type = "width")
## [1] 1
char_nfkd <- stringi::stri_trans_nfkd(char) # \u0065\u0301
nchar(char_nfkd, type = "width")
## [1] 0