I have a .csv file which is written in spanish so it has special characters like ñ, á, é, í, ó, ú. So if I open it in the notepad I can see all the characters properly written and I have already saved the file with UTF-8 encoding. However, when I open RStudio and I import the data using:
servutf <- read.csv("servutf.csv", sep=";")
I get all the dataset but incorrectly encoded i.e.:
Tengo 7 años de experiencia
It should be the following:
Tengo 7 años de experiencia
I have tried everything, I don't know what else to do as I have already checked that R is using UTF-8 encoding and the file is encoded in the same way.
Any suggestion please?
You need to specify the encoding
servutf <- read.csv("servutf.csv", sep=";", encoding = "UTF-8")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With