{"action":"created","issue":{"url":"https://api.github.com/repos/cms-dev/cms/issues/627","repository_url":"https://api.github.com/repos/cms-dev/cms","labels_url":"https://api.github.com/repos/cms-dev/cms/issues/627/labels{/name}","comments_url":"https://api.github.com/repos/cms-dev/cms/issues/627/comments","events_url":"https://api.github.com/repos/cms-dev/cms/issues/627/events","html_url":"https://github.com/cms-dev/cms/pull/627","id":162163436,"number":627,"title":"ExportSubmissions: Avoid utf-8 decoding when --add-info is not given","user":{"login":"wafrelka","id":4510500,"avatar_url":"https://avatars.githubusercontent.com/u/4510500?v=3","gravatar_id":"","url":"https://api.github.com/users/wafrelka","html_url":"https://github.com/wafrelka","followers_url":"https://api.github.com/users/wafrelka/followers","following_url":"https://api.github.com/users/wafrelka/following{/other_user}","gists_url":"https://api.github.com/users/wafrelka/gists{/gist_id}","starred_url":"https://api.github.com/users/wafrelka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wafrelka/subscriptions","organizations_url":"https://api.github.com/users/wafrelka/orgs","repos_url":"https://api.github.com/users/wafrelka/repos","events_url":"https://api.github.com/users/wafrelka/events{/privacy}","received_events_url":"https://api.github.com/users/wafrelka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-24T14:47:48Z","updated_at":"2016-06-29T07:06:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cms-dev/cms/pulls/627","html_url":"https://github.com/cms-dev/cms/pull/627","diff_url":"https://github.com/cms-dev/cms/pull/627.diff","patch_url":"https://github.com/cms-dev/cms/pull/627.patch"},"body":"With this patch, we can avoid utf-8 conversion errors when a submission includes invalid chars. (It can happen when a contestant writes some comments in source code with an encoding other than utf-8)\r\nAdditionally, we can save time of unnecessary utf-8 conversion.\r\n\r\nMaybe it is good to deal with utf-8 conversion error when --add-info is given, but I don't know how to.\r\n(Ignoring invalid chars using `codecs.decode` function with `errors=ignore`, or concatenating utf-8 encoded additional info and source code as byte sequences?)\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cms-dev/cms/627)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cms-dev/cms/issues/comments/229274060","html_url":"https://github.com/cms-dev/cms/pull/627#issuecomment-229274060","issue_url":"https://api.github.com/repos/cms-dev/cms/issues/627","id":229274060,"user":{"login":"wafrelka","id":4510500,"avatar_url":"https://avatars.githubusercontent.com/u/4510500?v=3","gravatar_id":"","url":"https://api.github.com/users/wafrelka","html_url":"https://github.com/wafrelka","followers_url":"https://api.github.com/users/wafrelka/followers","following_url":"https://api.github.com/users/wafrelka/following{/other_user}","gists_url":"https://api.github.com/users/wafrelka/gists{/gist_id}","starred_url":"https://api.github.com/users/wafrelka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wafrelka/subscriptions","organizations_url":"https://api.github.com/users/wafrelka/orgs","repos_url":"https://api.github.com/users/wafrelka/repos","events_url":"https://api.github.com/users/wafrelka/events{/privacy}","received_events_url":"https://api.github.com/users/wafrelka/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T07:06:26Z","updated_at":"2016-06-29T07:06:26Z","body":"Personally, I think CMS should be just a pipe between contestants and core judging system including compilers, managers and output checkers. It shouldn't handle encoding problems at all so that users and compilers can use any encodings they want. Converting and modifying submissions may result in the difference of judging result between CMS and contestants side.\r\nIf we want to show user submissions in the admin page, we should guess encodings and convert submissions at the rendering of utf-8 encoded html page.\r\n\r\nThe word \"integrity\" I used means that we can always reproduce the same result at a local side with exported submission files as CMS produces at the server side. Converting submissions may break it and that's why I don't want to avoid utf-8 encoding."}}
{"actor":{"display_login":"wafrelka"}}