title: Encoding issues when trying to write data from R to MySQL
body: <p>My data contains special characters like German umlauts.</p>
  
  <pre><code>p=structure(list(ppl_code = c(992621L, 992381L, 992136L, 991989L, 
  991898L, 991759L, 991681L, 991593L, 991294L, 991036L, 990934L, 
  990751L, 990535L, 990411L, 990182L, 989507L), proj_name = c("klo", 
  "Dalbygda", "Oosterhorn", "Hån", "Yatir", "Montigny la Cour", 
  "Valle Hermoso", "Acciona Honawad - 120 MW", "Apfeltrang", "RiaBlades", 
  "General Acha", "Lindau-Böhlitz", "Apfeltrang", "Alcazar Round 2", 
  "Peckelsheim", "Linnich 3")), .Names = c("ppl_code", "proj_name"
  ), row.names = 15:30, class = "data.frame")
  </code></pre>
  
  <p>When I try to write it into MySQL database :</p>
  
  <pre><code>conn &lt;- dbConnect(
         drv = RMySQL::MySQL(),
         dbname = "mydb",
         host = "#####",
         username = "#####",
         password = "#####")
  
  dbWriteTable(conn, value = p, name = "MyTable",row.names=FALSE)
  </code></pre>
  
  <p>I'm getting the Encoding error :</p>
  
  <pre><code>could not run statement: Invalid utf8 character string: 'Lindau-B'
  </code></pre>
  
  <p>I have checked several posts regarding this issue like <a href="https://stackoverflow.com/questions/38347348/utf8-encoding-using-rmysql?rq=1">here</a> and <a href="https://stackoverflow.com/questions/5984647/german-umlauts-in-mysql-insert">here</a> but they are all general explanation without a clear solution !
  can anybody help me with a clear query that could solve this issue ?</p>