It seems that I have problem working with Chinese characters in my R Studio. A simple codes like the following:
data <- c("物品","方案")
data
# [1] "\347\211\251\345\223\201" "\346\226\271\346\241\210"
It remains the same even if I run
Sys.setlocale(category="LC_ALL",locale="chinese")*
This happened to both my Windows laptop and Mac.
Can anyone tell me how to configure the R Studio in order to read the data in Chinese properly?
Run in Shell R
Run in RStudio
By contrast, you can find the locale environment in RStudio is not set to support UTF-8.
You should not change the locale environment while RStudio is running, you can call Sys.setlocale in .Rprofile. (OS X is ok.)
You can find more information in R help
?Startup
and RStudio Character Encoding