Character encoding in R

character-encoding, r

Solution

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.

Problem

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!!

Original source