I'm on Windows 8.1 (en) and my R console won't understand Russian characters and produce smth like this (both in console and if I run R file)
> x <- "Привет"
> print(x)
[1] "Ïðèâåò"
I know that this can happen if you save CP1251 as CP1252. I set up all R options to UTF-8, and source files as UTF-8, but this doesn't help. I also set up sysLocale to Russian as here, but got nothing. Some advise from RStudio faq didn't help either. The strange thing though, that ggplot2 works absolutely fine
dt <- as.data.frame(cbind(x = c("Один", "Два"), y = c(3, 5)))
ggplot(dt, aes(x=x, y=y))+geom_bar() + xlab("Счет")
This is my sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=Russian_Russia.1251 LC_CTYPE=Russian_Russia.1251 LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C
[5] LC_TIME=Russian_Russia.1251
attached base packages:
[1] stats graphics grDevices utils datasets methods base
I use last version of RStudio, but dev version also would not help
UPDATE:
> Encoding(x)
[1] "unknown"
> getOption("encoding")
[1] "native.enc"
If I use RGUI, after Sys.setlocale("LC_ALL", "Russian")
it will allow to
> print(x)
[1] "Привет"
I also checked in the Russian version of Windows - Rstudio works ok