title: Can't find a way to gather data and upload it again to a different SQL server without breaking the encoding R/dbPlyr/DBI
body: <p>Basic setup is that I connect to a database A, get some data back to R, write it to another connection, database B.</p>
  <p>The database is SQL_Latin1_General_CP1_CI_AS and I'm using encoding = &quot;windows-1252&quot; in connection A and B.</p>
  <p>Display in RStudio is fine, special characters show as they should.</p>
  <p>When I try to write the data, I get a &quot;Cannot insert the value NULL into column&quot;.</p>
  <p>I narrowed it down to at least one offending field: a cell with a PHI symbol, which causes the error.</p>
  <p>How do I make it so the PHI symbol and presumably other special characters are kept the same from source to destination?</p>
  <pre><code>conA &lt;- dbConnect(odbc(), 
                  Driver = &quot;ODBC Driver 17 for SQL Server&quot;,
                  Server = &quot;DB&quot;,
                  Database = &quot;serverA&quot;,
                  Trusted_connection = &quot;yes&quot;,
                  encoding = &quot;1252&quot;)
  
  dbWriteTable(conB,SQL(&quot;schema.table&quot;),failing_row, append = T)
  #This causes the &quot;cannot insert null value&quot; error
  </code></pre>