how to set charset for MySQL in RODBC

Posted by lokheart on Stack Overflow See other posts from Stack Overflow or by lokheart
Published on 2011-01-11T01:48:26Z Indexed on 2011/01/11 1:53 UTC
Read the original article Hit count: 489

Filed under:
|
|

I have a data with chinese characters as field names and data, I have imported them from xls to access 2007 and export them to ODBC. Then I use RODBC to read them in R, the field names is OK, but for the data, all of the chinese characters are shown as ?.

I have read the RODBC manual and it said:

If it is possible to set the DBMS or ODBC driver to communicate in the character set of the R session then this should be done. For example, MySQL can set the communication character set via SQL, e.g. SET NAMES 'utf8'.

I guess this is the problem, but how can I provide this command to MySQL via RODBC? Thanks!

© Stack Overflow or respective owner

Related posts about mysql

Related posts about r