1

I have exported a CSV file from Qualtrics (survey with multiple columns) and I am importing it into R using read.csv.

When I open the raw CSV file, the fields are all legible in the way I would expect--such as this.

 After reading “Sometimes, the Earth Cruel,” 

However when I read it into R, it shows up like this--

"After reading “Sometimes, the Earth Cruel,â" 

I know this has something to do when character encoding, but I don't know how to fix it. Please help!

NewBee
  • 990
  • 1
  • 7
  • 26

1 Answers1

0

It appears to work for me. I am on linux and I use UTF-8 encoding.

> x <- "After reading “Sometimes, the Earth Cruel,” "
> read.table(text = x, header = FALSE)
     V1      V2          V3  V4    V5      V6
1 After reading “Sometimes, the Earth Cruel,”

> Sys.getlocale()
[1] "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=sl_SI.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=sl_SI.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=sl_SI.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=sl_SI.UTF-8;LC_IDENTIFICATION=C"
Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
  • It works for me too when I just paste that text in as an object... This issue occurs when I read the entire CSV file into R. – NewBee Jul 08 '20 at 18:16