displaying Japanese characters retrieved from MySQL in R

后端 未结 2 1343
情深已故
情深已故 2020-12-10 19:26

I am struggling to display Japanese characters in a dataframe, which have been retrieved from a MySQL database using the RMySQL package. Japanese characters display fine if

相关标签:
2条回答
  • 2020-12-10 19:53

    When trying to use utf8/utf8mb4, if you see Question Marks (regular ones, not black diamonds),

    • The bytes to be stored are not encoded as utf8. Fix this.
    • The column in the database is CHARACTER SET utf8 (or utf8mb4). Fix this.
    • Also, check that the connection during reading is utf8.
    0 讨论(0)
  • 2020-12-10 19:59

    The problem seems to be fixed by adding the following line before retrieving that data:

    rs <- dbSendQuery(con, 'set character set "utf8"')
    
    0 讨论(0)
提交回复
热议问题