x <- c("Hello World", "Ekstr\xf8m", "J\xf6reskog", "bi\xdfchen Z\xfcrcher")
Encoding(x) <- "latin1"
x
rm_non_ascii(x)
rm_non_ascii(x, replacement="<>")
ex_non_ascii(x)
ex_non_ascii(x, ascii.out=FALSE)
## simple regex to remove non-ascii
rm_default(x, pattern="[^ -~]")
ex_default(x, pattern="[^ -~]")
Run the code above in your browser using DataLab