title: Encoding Issue when fetching data from MySQL DB into R
body: <p>I'm using the "RMySQL" library in R to load data from a local MySQL DB into R:</p>
  
  <pre><code>con &lt;- dbConnect(MySQL(), user="root", password="****", dbname="twitterdata", host="localhost")
  dataframe &lt;- dbGetQuery(con, "SELECT id, plaintext, category FROM table")
  </code></pre>
  
  <p>When I inspect the dataframe, I see a lot of unformatted characters such as the slanted apastrophe (<strong>´</strong>) which shows up as <strong>â€™</strong>.</p>
  
  <p>After some research, I discovered that according to <a href="http://www.i18nqa.com/debug/bug-iso8859-1-vs-windows-1252.html" rel="nofollow">this</a> site, some special characters (including the slanted apastrophe) are not part of the <strong>ISO-8859-1</strong> standard but of the <strong>Windows-1252</strong> standard.</p>
  
  <p>When I run</p>
  
  <pre><code>Sys.getlocale("LC_CTYPE")
  </code></pre>
  
  <p>in R, it says:</p>
  
  <pre><code>"German_Austria.1252"
  </code></pre>
  
  <p>Doesn't it already say that I'm on the correct encoding?!
  In my DB (Default Charset: UTF-8), the apostrophe is encoded well.</p>
  
  <p>I also tried to add a parameter to the dbConnect statement <strong>DBMSencoding="utf-8"</strong> but with no effect.</p>
  
  <p>When I run</p>
  
  <pre><code>Encoding(x)
  </code></pre>
  
  <p>in R (where x is the character vector - a sentence), the answer is</p>
  
  <pre><code>"unknown"
  </code></pre>
  
  <p>Does anybody know now to solve this issue?</p>
  
  <p>Thanks a lot!</p>