Skip to contents

Converts encoding of one character vector to another

Usage

sf_iconv(x, from, to, nthreads = getOption("stringfish.nthreads", 1L))

Arguments

x

An alt-rep object

from

the encoding to assume of `x`

nthreads

Number of threads to use

to

the new encoding

Value

the converted character vector as a stringfish vector

Details

This is an analogue to the base R function `iconv`. It converts a string from one encoding (e.g. latin1 or UTF-8) to another

See also

iconv

Examples

if(getRversion() >= "3.5.0") {
x <- "fa\xE7ile"
Encoding(x) <- "latin1"
sf_iconv(x, "latin1", "UTF-8")
}
#> [1] "façile"