Skip to contents

[Stable]

to_ascii() converts a string to ASCII, removing any non-ASCII characters.

Usage

to_ascii(x, from = "UTF-8")

Arguments

x

A character vector.

from

A character string indicating the encoding of the input string, See iconv to learn more. (Default: "UTF-8").

Value

A character vector.

See also

Examples

to_ascii("São Paulo")
#> [1] "Sao Paulo"
#> [1] "Sao Paulo" # Expected

to_ascii("Île-de-France")
#> [1] "Ile-de-France"
#> [1] "Ile-de-France" # Expected