title: R, Rstudio Console Encoding Windows
body: <p>I there a way to change the console encoding in Rstudio on windows? </p>
  
  <p>This is not about reading files or sourcing scripts in a specific encoding but about changing the console encoding (the encoding Sys.getlocale yields).</p>
  
  <p>This is usually not a big problem, but i try to create a package and I'm using german umlauts in some strings and symbols. <code>roxygen2</code> works best with <code>UTF-8</code> encoding but <code>covr</code> gives an error if the source files are not in the console/system encoding.</p>
  
  <p>(If there's a workaround for the <code>roxygen2</code> and <code>covr</code> problem this would also help. Addintional info: I call <code>covr::package_coverage</code> from the console and I call <code>roxygen2</code> via Rstudios Build command.)</p>
  
  <p>and sessioninfo:</p>
  
  <pre><code>sessionInfo()
  # R version 3.4.2 (2017-09-28)
  # Platform: x86_64-w64-mingw32/x64 (64-bit)
  # Running under: Windows &gt;= 8 x64 (build 9200)
  # 
  # Matrix products: default
  # 
  # locale:
  # [1] LC_COLLATE=German_Austria.1252  LC_CTYPE=German_Austria.1252    LC_MONETARY=German_Austria.1252 LC_NUMERIC=C                    LC_TIME=German_Austria.1252    
  </code></pre>
  
  <p>Update: Sourcing the function that gives an error through the file in Rstudio works, loading with <code>devtools::load_all(".")</code> and the RStudio gui gives the error/wrong encoding.</p>