{"action":"opened","issue":{"url":"https://api.github.com/repos/acatton/flatbencode/issues/2","repository_url":"https://api.github.com/repos/acatton/flatbencode","labels_url":"https://api.github.com/repos/acatton/flatbencode/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/acatton/flatbencode/issues/2/comments","events_url":"https://api.github.com/repos/acatton/flatbencode/issues/2/events","html_url":"https://github.com/acatton/flatbencode/issues/2","id":177465379,"number":2,"title":"UTF-8 should not be supported","user":{"login":"real-or-random","id":1071625,"avatar_url":"https://avatars.githubusercontent.com/u/1071625?v=3","gravatar_id":"","url":"https://api.github.com/users/real-or-random","html_url":"https://github.com/real-or-random","followers_url":"https://api.github.com/users/real-or-random/followers","following_url":"https://api.github.com/users/real-or-random/following{/other_user}","gists_url":"https://api.github.com/users/real-or-random/gists{/gist_id}","starred_url":"https://api.github.com/users/real-or-random/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/real-or-random/subscriptions","organizations_url":"https://api.github.com/users/real-or-random/orgs","repos_url":"https://api.github.com/users/real-or-random/repos","events_url":"https://api.github.com/users/real-or-random/events{/privacy}","received_events_url":"https://api.github.com/users/real-or-random/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-16T16:19:28Z","updated_at":"2016-09-16T16:19:28Z","closed_at":null,"body":"I think encoding UTF-8 to bytes silently is not a clean way, \r\nhttps://github.com/acatton/flatbencode/blob/master/flatbencode.py#L132\r\nand there is a XXX in the code. ;)\r\n\r\nThe problem is that it violates the concept that `decode(encode(x))=x` if `x` contains non-ASCII chars. I think the clean Python3 way is to reject strings. Bencoding supports only bytes, so if the user wants to encode a UTF-8 (or whatever) string, he needs to convert it to bytes explicitly.\r\n"}}
{"actor":{"display_login":"real-or-random"}}