{"action":"created","issue":{"url":"https://api.github.com/repos/geoadmin/mf-chsdi3/issues/1182","labels_url":"https://api.github.com/repos/geoadmin/mf-chsdi3/issues/1182/labels{/name}","comments_url":"https://api.github.com/repos/geoadmin/mf-chsdi3/issues/1182/comments","events_url":"https://api.github.com/repos/geoadmin/mf-chsdi3/issues/1182/events","html_url":"https://github.com/geoadmin/mf-chsdi3/pull/1182","id":52750888,"number":1182,"title":"Support special characters for similarity queries","user":{"login":"loicgasser","id":3306154,"avatar_url":"https://avatars.githubusercontent.com/u/3306154?v=3","gravatar_id":"","url":"https://api.github.com/users/loicgasser","html_url":"https://github.com/loicgasser","followers_url":"https://api.github.com/users/loicgasser/followers","following_url":"https://api.github.com/users/loicgasser/following{/other_user}","gists_url":"https://api.github.com/users/loicgasser/gists{/gist_id}","starred_url":"https://api.github.com/users/loicgasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loicgasser/subscriptions","organizations_url":"https://api.github.com/users/loicgasser/orgs","repos_url":"https://api.github.com/users/loicgasser/repos","events_url":"https://api.github.com/users/loicgasser/events{/privacy}","received_events_url":"https://api.github.com/users/loicgasser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"procrastinatio","id":1236739,"avatar_url":"https://avatars.githubusercontent.com/u/1236739?v=3","gravatar_id":"","url":"https://api.github.com/users/procrastinatio","html_url":"https://github.com/procrastinatio","followers_url":"https://api.github.com/users/procrastinatio/followers","following_url":"https://api.github.com/users/procrastinatio/following{/other_user}","gists_url":"https://api.github.com/users/procrastinatio/gists{/gist_id}","starred_url":"https://api.github.com/users/procrastinatio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/procrastinatio/subscriptions","organizations_url":"https://api.github.com/users/procrastinatio/orgs","repos_url":"https://api.github.com/users/procrastinatio/repos","events_url":"https://api.github.com/users/procrastinatio/events{/privacy}","received_events_url":"https://api.github.com/users/procrastinatio/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2014-12-23T15:52:18Z","updated_at":"2015-01-07T14:32:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/geoadmin/mf-chsdi3/pulls/1182","html_url":"https://github.com/geoadmin/mf-chsdi3/pull/1182","diff_url":"https://github.com/geoadmin/mf-chsdi3/pull/1182.diff","patch_url":"https://github.com/geoadmin/mf-chsdi3/pull/1182.patch"},"body":"This PR is for: https://github.com/geoadmin/mf-geoadmin3/issues/2009\r\n\r\nAt some point the where `unicode` will be converted to byte `str` and will fail because for some reason we have non-ASCII unicode strings.\r\n\r\nThe famous `UnicodeError` ...\r\n\r\nHere we \r\n1. Build a query to postrges can understand (Escaping the `\\`  and telling postrgres to escape it with E)\r\n2. We convert to byte `str` and replace unmapped characters with `?` that we finally replace with `%`\r\n\r\nIt's a workaround but it works fine.\r\nIf anybody has a better solution/understanding of what's going on please feel free.\r\n\r\n[Current Link in prod]\r\n(http://api3.geo.admin.ch/rest/services/all/MapServer/identify?geometryFormat=geojson&lang=fr&layers=all:ch.swisstopo.geologie-geotope&time=2013&where=nom+ilike+%27%25Bloc+erratique+rhodanien+de+la+L%C3%A9cherette+(Ch%C3%A2teau+d%27Oex,+VD)%25%27)\r\n\r\n[Deployed Branch in test]\r\n(http://mf-chsdi3.dev.bgdi.ch/gal_handle_accents/rest/services/all/MapServer/identify?geometryFormat=geojson&lang=fr&layers=all:ch.swisstopo.geologie-geotope&time=2013&where=nom+ilike+%27%25Bloc+erratique+rhodanien+de+la+L%C3%A9cherette+(Ch%C3%A2teau+d%27Oex,+VD)%25%27)\r\n"},"comment":{"url":"https://api.github.com/repos/geoadmin/mf-chsdi3/issues/comments/69028892","html_url":"https://github.com/geoadmin/mf-chsdi3/pull/1182#issuecomment-69028892","issue_url":"https://api.github.com/repos/geoadmin/mf-chsdi3/issues/1182","id":69028892,"user":{"login":"procrastinatio","id":1236739,"avatar_url":"https://avatars.githubusercontent.com/u/1236739?v=3","gravatar_id":"","url":"https://api.github.com/users/procrastinatio","html_url":"https://github.com/procrastinatio","followers_url":"https://api.github.com/users/procrastinatio/followers","following_url":"https://api.github.com/users/procrastinatio/following{/other_user}","gists_url":"https://api.github.com/users/procrastinatio/gists{/gist_id}","starred_url":"https://api.github.com/users/procrastinatio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/procrastinatio/subscriptions","organizations_url":"https://api.github.com/users/procrastinatio/orgs","repos_url":"https://api.github.com/users/procrastinatio/repos","events_url":"https://api.github.com/users/procrastinatio/events{/privacy}","received_events_url":"https://api.github.com/users/procrastinatio/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T14:32:15Z","updated_at":"2015-01-07T14:32:15Z","body":"Hmm, do not understand why you have to convert to ascii, the column type in the model should be `sqlalchemy.types.Unicode`"}}