encoding - R Studio does not work with Chinese Characters properly -
encoding - R Studio does not work with Chinese Characters properly -
it seems have problem working chinese characters in r studio. simple codes following:
data <- c("物品","方案") info # [1] "\347\211\251\345\223\201" "\346\226\271\346\241\210"
it remains same if run
sys.setlocale(category="lc_all",locale="chinese")*
this happened both windows laptop , mac.
can tell me how configure r studio in order read info in chinese properly?
run in shell r
> print("中文") [1] "中文" > sys.getlocale() [1] "en_us.utf-8/en_us.utf-8/en_us.utf-8/c/en_us.utf-8/en_us.utf-8"
run in rstudio
> print("中文") [1] "\344\270\255\346\226\207" > sys.getlocale() [1] "c"
by contrast, can find locale environment in rstudio not set back upwards utf-8.
you should not alter locale environment while rstudio running, can phone call sys.setlocale in .rprofile. (os x ok.)
$ cat ~/.rprofile sys.setlocale(category="lc_all", locale = "en_us.utf-8")
you can find more info in r help ?startup
, rstudio character encoding
r encoding
Comments
Post a Comment