1

I am using read.xlsx to load a spreadsheet that has several columns containing Chinese characters.

slides<-read.xlsx("test1.xlsx",sheetName="Sheet1",encoding="UTF8",stringsAsFactors=FALSE)

I have tried with and without specifying encoding, I have tried reading from a text file, CSV file etc. No matter the approach, the result is always:

                  樊志强 ->  é‡åº†æ–°æ¡¥åŒ»é™¢ 

Is there any package/format/sys.locale setup that might help me get the right information into R?

Any help would be greatly appreciated.

agatha
  • 1,513
  • 5
  • 16
  • 28

1 Answers1

1

You can try the readr package, and use the following code:

library(readr)
loc <- locale(encoding = "UTF-8")
slides <-  read_table("filename", locale = loc)