-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Character encoding in dbWriteTable in R #57
Comments
Rather than using a csv, could you please include |
This works for me: con <- dbConnect(MySQL())
df <- data.frame(x = 1, y = "佃煮惣菜")
dbWriteTable(con, 'test-utf8', df, temporary = TRUE)
dbReadTable(con, 'test-utf8')
dbDisconnect(con) |
(I see the warning too - it's on my list to fix) Are you on linux? |
Hello Hadley, Here are the outputs from some of your commands mentioned above:
Mysql Workbench also reports
for y.
results in
results in
I'm also having issue retrieving unicode characters.
In my.ini, I have
Could you help me with pin-pointing the issue? Thanks in advance. |
Related: #93. |
I also thought I had this issue, but it turned out this was because my MySQL database had the default latin1 charset. The following query fixes this:
|
@valentas-kurauskas : I am going to run the above command on my database (of course taking a backup of it before that). Will it solve the problem of R unable to write to the MySQL DB using INSERT - VALUES. This happens when R outputs a character vector with single quotes (sQoute)? |
Nopes. MySQL database is already on utf8_general_ci;
|
Moved to rstats-db/RMariaDB (see link above). |
I'm failing to get correct (Japanese) characters when writing a dataframe to MySQL using dbWriteTable. For example if I read the following lines from a CSV file into R, the characters display correctly, but when written to a MySQL table they appear as series of ???. The text lines..
"00043","201411","こんにゃく","おかずその他","普及",2,2
"00043","201411","こんにゃく","おかずその他","通年",1,1
"00043","201411","こんにゃく","その他こんにゃく","-",1,1
"00043","201411","こんにゃく","つき白滝","中質",4,3
"00043","201411","こんにゃく","つき白滝","普及",4,1
The R code..
The text was updated successfully, but these errors were encountered: