title: R Wrong encoding in Rstudio console (but ok in R GUI and ggplot2)
body: <p>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)</p>
  
  <pre><code>&gt; x &lt;- "Привет"
  &gt; print(x)
  [1] "Ïðèâåò"
  </code></pre>
  
  <p>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 <a href="https://stackoverflow.com/questions/5031630/how-to-source-r-file-saved-using-utf-8-encoding">here</a>, but got nothing. Some advise from <a href="http://www.rstudio.com/ide/docs/advanced/encoding" rel="nofollow noreferrer">RStudio faq</a> didn't help either. The strange thing though, that ggplot2 works absolutely fine</p>
  
  <pre><code>dt &lt;- as.data.frame(cbind(x = c("Один", "Два"), y = c(3, 5)))
  ggplot(dt, aes(x=x, y=y))+geom_bar() + xlab("Счет")
  </code></pre>
  
  <p>This is my sessionInfo()</p>
  
  <pre><code>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     
  </code></pre>
  
  <p>I use last version of RStudio, but dev version also would not help</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <pre><code>&gt; Encoding(x)
  [1] "unknown"
  &gt; getOption("encoding")
  [1] "native.enc"
  </code></pre>
  
  <p>If I use RGUI, after <code>Sys.setlocale("LC_ALL", "Russian")</code> it will allow to </p>
  
  <pre><code>&gt; print(x)
  [1] "Привет"
  </code></pre>
  
  <p>I also checked in the Russian version of Windows - Rstudio works ok</p>