title: RMarkdown utf-8 error on mutliple operating systems
body: <p>We have a problem using RMarkdown on multiple operating systems. </p>
  
  <p>Initially, an .Rmd file is created on a Linux system (Ubuntu 12.04 LTS) and then pushed to a GitHub repo. </p>
  
  <p>It can be compiled ("knitted") without problems on this system.</p>
  
  <p>It is then pulled on a Windows 7 machine with RStudio installed. </p>
  
  <p>There, when trying to compile, the following error shows up:</p>
  
  <pre><code>Error in yaml::yaml.load(front_matter) : 
    Reader error: invalid leading UTF-8 octet: #FC at 66
  Calls: &lt;Anonymous&gt; -&gt; parse_yaml_front_matter -&gt; &lt;Anonymous&gt; -&gt; .Call
  Execution halted
  </code></pre>
  
  <ol>
  <li>When creating another .Rmd file on the Windows system, it works flawlessly.</li>
  <li>When creating another .Rmd file on the Windows system, and copying everything but the first few lines of the "problematic" file to the other .Rmd file, and compiling this file, it works flawlessly.</li>
  </ol>
  
  <p>I compared both files in HEX (in Sublime) on both operating systems: They are EXACTLY the same. </p>
  
  <p>Has somebody else seen that error before? </p>
  
  <p><strong>Update</strong>: It seems as if a German Umlaut ("ü") is causing the problem, as its UTF-8 "Escaped Unicode" is \uFC, according to <a href="http://www.endmemo.com/unicode/unicodeconverter.php" rel="noreferrer">http://www.endmemo.com/unicode/unicodeconverter.php</a></p>
  
  <p>In general, it seems that Unicode is not correctly recognized by either R, RStudio or knitr on Windows. When I type in some Umlauts in a new .Rmd file, and knit it, I get output such as "Ã¶Ã¤Ã¤". In RStudio > Tools > Global options, I set the Default text encoding to "UTF-8". And I also did that for R, in the RProfile.site file (<code>options(encoding="UTF-8")</code>). </p>
  
  <p><strong>Update 2:</strong> <code>library(rmarkdown); sessionInfo()</code> gives </p>
  
  <pre><code>R version 3.1.2 (2014-10-31)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  
  locale:
  [1] LC_COLLATE=German_Switzerland.1252  LC_CTYPE=German_Switzerland.1252    LC_MONETARY=German_Switzerland.1252
  [4] LC_NUMERIC=C                        LC_TIME=German_Switzerland.1252    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] rmarkdown_0.4.2
  
  loaded via a namespace (and not attached):
  [1] digest_0.6.8    htmltools_0.2.6 tools_3.1.2    
  </code></pre>
  
  <p>on Windows 7, whereas, on Ubuntu, it is: </p>
  
  <pre><code>R version 3.1.2 (2014-10-31)
  Platform: x86_64-pc-linux-gnu (64-bit)
  
  locale:
   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
   [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
   [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] rmarkdown_0.3.10
  
  loaded via a namespace (and not attached):
  [1] digest_0.6.8    htmltools_0.2.6 tools_3.1.2   
  </code></pre>
  
  <p>I already suspect the problem to be the diverging locale... how do I fix this? </p>