{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/1470","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/1470/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/1470/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/1470/events","html_url":"https://github.com/dotnet/corefx/pull/1470","id":70207477,"number":1470,"title":"Fix #1339: Change encoding of .cs files to utf-8 without BOM","user":{"login":"krwq","id":660048,"avatar_url":"https://avatars.githubusercontent.com/u/660048?v=3","gravatar_id":"","url":"https://api.github.com/users/krwq","html_url":"https://github.com/krwq","followers_url":"https://api.github.com/users/krwq/followers","following_url":"https://api.github.com/users/krwq/following{/other_user}","gists_url":"https://api.github.com/users/krwq/gists{/gist_id}","starred_url":"https://api.github.com/users/krwq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krwq/subscriptions","organizations_url":"https://api.github.com/users/krwq/orgs","repos_url":"https://api.github.com/users/krwq/repos","events_url":"https://api.github.com/users/krwq/events{/privacy}","received_events_url":"https://api.github.com/users/krwq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/2%20-%20In%20Progress","name":"2 - In Progress","color":"CCCCCC"},{"url":"https://api.github.com/repos/dotnet/corefx/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-22T18:55:13Z","updated_at":"2015-04-25T05:45:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/1470","html_url":"https://github.com/dotnet/corefx/pull/1470","diff_url":"https://github.com/dotnet/corefx/pull/1470.diff","patch_url":"https://github.com/dotnet/corefx/pull/1470.patch"},"body":"Conversion script:\r\nFor each .cs file:\r\n- Read all bytes\r\n- Analyze BOM to get encoding\r\n- If encoding not any of those then end: Encoding.UTF32;  Encoding.BigEndianUnicode; Encoding.Unicode\r\n- Get string from bytes read from the file (encoding.GetString(bytes))\r\n- Get utf-8 (no BOM) bytes from the string ((new Utf8Encoding(false)).GetBytes(str))\r\n- Save to file\r\n\r\nI'm not sure to reliably check if we didn't lose anything although I did run all tests (including outerloop) and made sure no test is testing anything related to encoding (looking at the file name)\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/96133873","html_url":"https://github.com/dotnet/corefx/pull/1470#issuecomment-96133873","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/1470","id":96133873,"user":{"login":"sharwell","id":1408396,"avatar_url":"https://avatars.githubusercontent.com/u/1408396?v=3","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"created_at":"2015-04-25T05:45:42Z","updated_at":"2015-04-25T05:45:42Z","body":":exclamation: The files need a byte order mark."}}