[R] Reading UTF-8 from MySQL in Windows

Tomas Krilavičius t.krilavicius at gmail.com
Thu Jan 8 15:31:48 CET 2009


Dear R-help,

I am reading strings (varchar) from MySQL database
and instead of some characters get garbled chars.
Strings are encoded in UTF-8. I have tried to change
encoding in MySQL to latin7, but it does not help.

I was not able to find solution, how to get strings
in proper encoding/form.


------ OS
windows xp

------ R info
MySQL connection commands
library( RMySQL ) ## load RMySQL and DBI packages
drv <- dbDriver( "MySQL" )

 > l10n_info()
$MBCS
[1] FALSE
$`UTF-8`
[1] FALSE
$`Latin-1`
[1] FALSE
$codepage
[1] 1257
 > Sys.getlocale()
[1] 
"LC_COLLATE=Lithuanian_Lithuania.1257;LC_CTYPE=Lithuanian_Lithuania.1257;LC_MONETARY=Lithuanian_Lithuania.1257;LC_NUMERIC=C;LC_TIME=Lithuanian_Lithuania.1257"

 > R.Version()
$platform
[1] "i386-pc-mingw32"
$arch
[1] "i386"
$os
[1] "mingw32"
$system
[1] "i386, mingw32"
$status
[1] ""
$major
[1] "2"
$minor
[1] "8.0"
$year
[1] "2008"
$month
[1] "10"
$day
[1] "20"
$`svn rev`
[1] "46754"
$language
[1] "R"
$version.string
[1] "R version 2.8.0 (2008-10-20)"

-- 
regards,
tomas krilavičius
http://www.surface.lt/krilaviciust




More information about the R-help mailing list