title: Code works in console but not in source, because of the encoding
body: <p>My source files with R scripts were working just fine. Recently I copied them to another computer (Windows too), but now these scripts just aren't working, because of the encoding problems. First of all, scripts became corrupted and after I fixed them, I still can't run it. Whatever I do (whatever encoding I use), mistakes appear.</p>
  
  <p>At the same time, if I copy the code to the console, it works just fine. I've broken my head on it and would appreciate any help. The problem is with Cyrillic symbols.</p>
  
  <p>Here is a small example:</p>
  
  <pre><code>data &lt;- data.frame('имя' = c("1", "2"), values = c(1, 2))
  text &lt;- c("раз", "два", "три")
  column &lt;- data$имя
  </code></pre>
  
  <p>As I said, this code works in console, but not in source. I've tried to follow the advices given in other questions about problems with Cyrillic encoding, but without any positive result.</p>