Search notes:

R mode: character

Encodings

A character string in R is encoded in one of
The used (declared) encoding can be determined with Encoding() which returns a character vector with one of the following values:
getOption('encoding')
Encoding(…)
Sys.getlocale('LC_ALL')
l10info()
enc2native(…)
enc2utf8(…)
anyString <- "Söme strängé tëxt"

# Interprete bytes in anyString as latin1
Encoding(anyString) <- 'latin1'

# Convert (hopefully natively as latin1 encoded) string to utf8
stringUTF8 <- enc2utf8(anyString)

See also

charToRaw(…), nchar(…), Encoding(…)
mode

Index