SQL encoding error

I'm trying to upload a dataframe to an SQL table, but I keep getting errors with regards to character encoding.

To isolate the issue, I'm looking at this string - "ចននី G 18/05/2018 $21.20 RC18-DGM1-WEB".

I'm using the bcputility package to upload the data, and when I pull the uploaded data back out, I get "ßPàßPôßPôßP+ G 18/05/2018 $21.20 RC18-DGM1-WEB" instead.

I've tried setting the bcpOptions flag (in the function bcpImport) as list("-c", "-C 65001") after reading this page.
I've also tried using DBI::dbWriteTable instead with the encoding = "UTF-8" flag passed to dbConnect.
I've tried using stringi::str_enc_toutf8 on the data before uploading.

When I use dbWriteTable to push the data, the output looks like "???? G 18/05/2018 $21.20 RC18-DGM1-WEB".

I'm quite stuck as to how to troubleshoot this next, so any help would be appreciated.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.