{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/11047","labels_url":"https://api.github.com/repos/pydata/pandas/issues/11047/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/11047/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/11047/events","html_url":"https://github.com/pydata/pandas/issues/11047","id":105764195,"number":11047,"title":"to_sql throws latin-1 encoding error even though everything seems encoded in utf-8","user":{"login":"alybel","id":7398719,"avatar_url":"https://avatars.githubusercontent.com/u/7398719?v=3","gravatar_id":"","url":"https://api.github.com/users/alybel","html_url":"https://github.com/alybel","followers_url":"https://api.github.com/users/alybel/followers","following_url":"https://api.github.com/users/alybel/following{/other_user}","gists_url":"https://api.github.com/users/alybel/gists{/gist_id}","starred_url":"https://api.github.com/users/alybel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alybel/subscriptions","organizations_url":"https://api.github.com/users/alybel/orgs","repos_url":"https://api.github.com/users/alybel/repos","events_url":"https://api.github.com/users/alybel/events{/privacy}","received_events_url":"https://api.github.com/users/alybel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/IO%20SQL","name":"IO SQL","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-10T09:01:48Z","updated_at":"2015-09-10T11:43:13Z","closed_at":null,"body":"I want to upload a file from csv to mysql with the following commands\r\n\r\n````\r\n df = pandas.read_csv('test.csv', encoding = 'utf-8')\r\nengine = sqlalchemy.create(<Mysql-Connection-URI>, encoding = 'utf-8')\r\ndf.to_sql('testtable', con = engine)\r\n````\r\nmysql has utf-8 as global encoding. If I upload the file manually to the database it goes without problems. \r\n\r\nusing to_sql throws the following errror: \r\n`UnicodeEncodeError: 'latin-1' codec can't encode character '\\u015e'`etc...\r\n\r\nAny ideas, where Latin-1 becomes part of the games and how this could be fixed? Thanks for any advice!"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/139211180","html_url":"https://github.com/pydata/pandas/issues/11047#issuecomment-139211180","issue_url":"https://api.github.com/repos/pydata/pandas/issues/11047","id":139211180,"user":{"login":"jorisvandenbossche","id":1020496,"avatar_url":"https://avatars.githubusercontent.com/u/1020496?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T11:43:13Z","updated_at":"2015-09-10T11:43:13Z","body":"Aha :-)\r\n\r\nMaybe you raise the issue at sqlalchemy or pymysql (not sure which of the two is to blame that the encoding is not passed through properly)"}}