请问高手,如何解决R中向mysql写入中文时候出现乱码的问题?
用dbWriteTable写入:
> dbWriteTable(con,"t_user_label",userLabelMysql,row.names = FALSE, append = TRUE)
[1] TRUE
但是数据库中显示的是乱码,加入了dbSendQuery(con,'SET NAMES utf8')也是没用。
尝试手工sql写入,R报错如下:
> strSQL<-"insert into t_user_label (account_id, label, frequency, update_time) values (89,'医药生物', 6.669725, '2016-08-31' )"
> dbSendQuery(con, strSQL)
Error in .local(conn, statement, ...) : 
  could not run statement: Incorrect string value: '\xC9\xFA\xCE\xEF' for column 'label' at row 1
这个问题实在是十分困扰,请问有没高手有解决方案,对了数据库字符集是UTF-8。
不胜感激。