{"action":"created","issue":{"url":"https://api.github.com/repos/coleifer/peewee/issues/574","labels_url":"https://api.github.com/repos/coleifer/peewee/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/coleifer/peewee/issues/574/comments","events_url":"https://api.github.com/repos/coleifer/peewee/issues/574/events","html_url":"https://github.com/coleifer/peewee/pull/574","id":68893544,"number":574,"title":"Support encoding in Postgres","user":{"login":"klen","id":90699,"avatar_url":"https://avatars.githubusercontent.com/u/90699?v=3","gravatar_id":"","url":"https://api.github.com/users/klen","html_url":"https://github.com/klen","followers_url":"https://api.github.com/users/klen/followers","following_url":"https://api.github.com/users/klen/following{/other_user}","gists_url":"https://api.github.com/users/klen/gists{/gist_id}","starred_url":"https://api.github.com/users/klen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klen/subscriptions","organizations_url":"https://api.github.com/users/klen/orgs","repos_url":"https://api.github.com/users/klen/repos","events_url":"https://api.github.com/users/klen/events{/privacy}","received_events_url":"https://api.github.com/users/klen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-16T10:22:45Z","updated_at":"2015-04-18T09:02:20Z","closed_at":"2015-04-17T17:17:32Z","pull_request":{"url":"https://api.github.com/repos/coleifer/peewee/pulls/574","html_url":"https://github.com/coleifer/peewee/pull/574","diff_url":"https://github.com/coleifer/peewee/pull/574.diff","patch_url":"https://github.com/coleifer/peewee/pull/574.patch"},"body":"Hello,\r\n\r\nIn my case I work with a lot of unicode data. All my databases have a UTF-8 encoding, but I've got errors like this: `UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128)`.\r\n\r\nI knew about the trick:\r\n```python\r\ndatabase = PosgresqlDatabase(database, **connection_params)\r\nconn = database.get_conn()\r\nconn.set_client_encoding('UTF8')\r\n```\r\n\r\nBut if you have multiple workers (or pool) it doesn't help and the error still appears. \r\n\r\nSo I provide the pull request.\r\n```\r\ndatabase = PostgresqlDatabase(database, encoding='UTF8', **connection_params)\r\n```\r\nWhich solve the problem completely."},"comment":{"url":"https://api.github.com/repos/coleifer/peewee/issues/comments/94145734","html_url":"https://github.com/coleifer/peewee/pull/574#issuecomment-94145734","issue_url":"https://api.github.com/repos/coleifer/peewee/issues/574","id":94145734,"user":{"login":"klen","id":90699,"avatar_url":"https://avatars.githubusercontent.com/u/90699?v=3","gravatar_id":"","url":"https://api.github.com/users/klen","html_url":"https://github.com/klen","followers_url":"https://api.github.com/users/klen/followers","following_url":"https://api.github.com/users/klen/following{/other_user}","gists_url":"https://api.github.com/users/klen/gists{/gist_id}","starred_url":"https://api.github.com/users/klen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klen/subscriptions","organizations_url":"https://api.github.com/users/klen/orgs","repos_url":"https://api.github.com/users/klen/repos","events_url":"https://api.github.com/users/klen/events{/privacy}","received_events_url":"https://api.github.com/users/klen/received_events","type":"User","site_admin":false},"created_at":"2015-04-18T09:02:20Z","updated_at":"2015-04-18T09:02:20Z","body":"Can I hope on patch-release?"}}