Fetching UTF-8 text from MySQL in R returns “????”

Thanks to @chooban I found out the connection session was using latin1 instead of utf8. Here are two solutions I found:

  • For RMySQL, after connecting run the query SET NAMES utf8 to change the connection character set.
  • For RODBC, connect using CharSet=utf8 in the DSN string. I was not able to run SET NAMES via ODBC.

This question pointed me in the right direction.

Leave a Comment