I am trying to read a csv file generated by Sql Server Management Studio and encoded as UTF-8 (I chose that option when saving it) into R version 3.0.1 (x64) through read.csv2(). I can't get R to display special characters correctly.
If I set fileEncoding="UTF-8-BOM" the import stops at the line where I have a ÿ. However, when opening the file in Notepad++ the ÿ is displayed correctly with UTF-8 encoding. I have tried without setting fileEncoding, but then the special characters aren't displayed correctly (of course).
The csv flie is available here: https://www.dropbox.com/s/7y47i826ikq8ahi/Data.csv
How do I read the csv file and display the text in the right encoding?
Thanks!!
I found the answer my self. The problem was with the transformantion from UTF-8 to the system locale (the default encoding in R) through fileEncoding. As I use RStudio, I just changed the default encoding to UTF-8 and removed the fileEncoding="UTF-8-BOM" from read.csv. Then, the entire csv file was read and RStudio displays all characters correctly.
To those that are still stuck with this issue. My scripts were able to recognise "umlaute" (ä, ö, ü, or ß) by including a line at the top of the script that changes the default option for character encoding options(encoding = "UTF-8") (In my case setting the options in RStudio direclty didn't effect the encodings!).
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