{"action":"created","issue":{"url":"https://api.github.com/repos/rstats-db/RMySQL/issues/57","labels_url":"https://api.github.com/repos/rstats-db/RMySQL/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/rstats-db/RMySQL/issues/57/comments","events_url":"https://api.github.com/repos/rstats-db/RMySQL/issues/57/events","html_url":"https://github.com/rstats-db/RMySQL/issues/57","id":60995267,"number":57,"title":"Character encoding in dbWriteTable in R","user":{"login":"jghigginson78","id":6358879,"avatar_url":"https://avatars.githubusercontent.com/u/6358879?v=3","gravatar_id":"","url":"https://api.github.com/users/jghigginson78","html_url":"https://github.com/jghigginson78","followers_url":"https://api.github.com/users/jghigginson78/followers","following_url":"https://api.github.com/users/jghigginson78/following{/other_user}","gists_url":"https://api.github.com/users/jghigginson78/gists{/gist_id}","starred_url":"https://api.github.com/users/jghigginson78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jghigginson78/subscriptions","organizations_url":"https://api.github.com/users/jghigginson78/orgs","repos_url":"https://api.github.com/users/jghigginson78/repos","events_url":"https://api.github.com/users/jghigginson78/events{/privacy}","received_events_url":"https://api.github.com/users/jghigginson78/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-13T06:23:25Z","updated_at":"2015-03-13T11:42:35Z","closed_at":null,"body":"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..\r\n\r\n\"00043\",\"201411\",\"こんにゃく\",\"おかずその他\",\"普及\",2,2\r\n\"00043\",\"201411\",\"こんにゃく\",\"おかずその他\",\"通年\",1,1\r\n\"00043\",\"201411\",\"こんにゃく\",\"その他こんにゃく\",\"-\",1,1\r\n\"00043\",\"201411\",\"こんにゃく\",\"つき白滝\",\"中質\",4,3\r\n\"00043\",\"201411\",\"こんにゃく\",\"つき白滝\",\"普及\",4,1\r\n\r\nThe R code..\r\n\r\n```R\r\nlibrary(RMySQL)\r\n\r\nDF <- read.csv('fpo.csv', stringsAsFactors=FALSE)\r\ndbase <- 'wnp_2_3_new'\r\ncon <- dbConnect(MySQL(), user='root', password=pw, dbname=dbase)\r\nrs <- dbGetQuery(con, 'set character set utf8')\r\ndbWriteTable(con, 'fpo_out', overwrite=TRUE, DF)\r\ndbDisconnect(con)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rstats-db/RMySQL/issues/comments/78932698","html_url":"https://github.com/rstats-db/RMySQL/issues/57#issuecomment-78932698","issue_url":"https://api.github.com/repos/rstats-db/RMySQL/issues/57","id":78932698,"user":{"login":"jghigginson78","id":6358879,"avatar_url":"https://avatars.githubusercontent.com/u/6358879?v=3","gravatar_id":"","url":"https://api.github.com/users/jghigginson78","html_url":"https://github.com/jghigginson78","followers_url":"https://api.github.com/users/jghigginson78/followers","following_url":"https://api.github.com/users/jghigginson78/following{/other_user}","gists_url":"https://api.github.com/users/jghigginson78/gists{/gist_id}","starred_url":"https://api.github.com/users/jghigginson78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jghigginson78/subscriptions","organizations_url":"https://api.github.com/users/jghigginson78/orgs","repos_url":"https://api.github.com/users/jghigginson78/repos","events_url":"https://api.github.com/users/jghigginson78/events{/privacy}","received_events_url":"https://api.github.com/users/jghigginson78/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T11:42:35Z","updated_at":"2015-03-13T11:42:35Z","body":"I don’t know if it is relevant but the pre-rewrite version of dbWriteTable worked for me, at least in terms of writing recognisable Japanese characters to the database\n\n\n> On Mar 13, 2015, at 20:31, Hadley Wickham <notifications@github.com> wrote:\n> \n> (I see the warning too - it's on my list to fix) Are you on linux?\n> \n> —\n> Reply to this email directly or view it on GitHub <https://github.com/rstats-db/RMySQL/issues/57#issuecomment-78928457>.\n> \n\n"}}