[R-sig-DB] MySQL R Encoding Utf8

Henri Mone henr|Mone @end|ng |rom gm@||@com
Wed Feb 8 19:24:38 CET 2012


Dear R Users and Experts,

I got a MySQL table with German special characters (umlaute like ä,ö,ü
etc.) . The MySQL database table is in the UTF8 format, and if I
submit a query over the MySql client the umlaute are displayed
correctly. If I submit the same query via R the umlaute are displayed
wrong. That is a little confusing for me, R as well as the MySQL
support UTF8.
Is there any option which I should use to get the umlaute in R correct?

Thanks,
Henri


> t.m <-dbDriver("MySQL")
> t.con <- try(dbConnect(t.m))
> t.rs <- try(dbSendQuery(t.con, t.sql))
> t.data <- fetch(t.rs,-1)
> t.data  # correct would be "Österreichische Schilling"
  \xd6sterreichische Schilling
  ...




More information about the R-sig-DB mailing list