title: Best practice: Should I try to change to UTF-8 as locale or is it safe to leave it as is?
body: <p>I try to set my default encoding to UTF-8; up to now without success:</p>
  
  <pre><code>a &lt;- "Hallo"
  b &lt;- "äöfd"
  print(Encoding(a))
  # [1] "unknown"
  print(Encoding(b))
  # [1] "latin1"
  
  options(encoding = "UTF-8")
  a &lt;- "Hallo"
  b &lt;- "äöfd"
  print(Encoding(a))
  # [1] "unknown"
  print(Encoding(b))
  # [1] "latin1"
  
  old_locale &lt;- Sys.getlocale()
  Sys.setlocale(category = "LC_ALL", locale = "English_United States.1252")
  a &lt;- "Hallo"
  b &lt;- "äöfd"
  print(Encoding(a))
  # [1] "unknown"
  print(Encoding(b))
  # [1] "latin1"
  
  Sys.getlocale()
  # [1] "LC_COLLATE=German_Switzerland.1252;
  # LC_CTYPE=German_Switzerland.1252;
  # LC_MONETARY=German_Switzerland.1252;
  # LC_NUMERIC=C;LC_TIME=German_Switzerland.1252"
  </code></pre>
  
  <p>I found the following links <a href="https://stackoverflow.com/questions/18099375/character-encoding-in-r?rq=1">R Encoding for files</a> and <a href="https://stackoverflow.com/questions/20577764/set-locale-to-system-default-utf-8">How to use Sys.setlocale()</a> but as you can see it seems they don't work in my case and I don't understand why.</p>
  
  <p>I also tried <code>Sys.setlocale(category = "LC_ALL", locale = "en_US.UTF-8")</code> but got</p>
  
  <blockquote>
    <p>Warning message: In Sys.setlocale(category = "LC_ALL", locale =
    "en_US.UTF-8") :   OS reports request to set locale to "en_US.UTF-8"
    cannot be honored</p>
  </blockquote>
  
  <p>In <code>cmd</code> the command <code>systeminfo &amp; pause</code> gives</p>
  
  <blockquote>
    <p>Systemgebietsschema:                           de-ch;Deutsch (Schweiz)
    Eingabegebietsschema:                          de-ch;Deutsch (Schweiz)</p>
  </blockquote>
  
  <p><strong>Edit</strong>:</p>
  
  <ul>
  <li>I fear that <code>"unknown"</code> encoding could lead to mistakes which I am not aware and </li>
  <li>I thought that it was good to use the new standard UTF-8 to avoid problems like the one I had.</li>
  <li>Last but not least I would like to be able to get reproducible results - a colleague is working on a Mac (with less issues concerning encoding)...</li>
  </ul>
  
  <p><strong>Edit2:</strong> What is the experience with this issue? Is there any best practice?</p>