{"action":"created","comment":{"url":"https://api.github.com/repos/adobe/brackets-shell/pulls/comments/122678989","pull_request_review_id":44814511,"id":122678989,"diff_hunk":"@@ -448,18 +479,49 @@ int ReadFile(ExtensionString filename, ExtensionString encoding, std::string& co\n             error = ERR_CANT_READ;\n         }\n     } else {\n-        if (has_utf16_32_BOM(file_get_contents, len)) {\n+        if (has_utf_32_BOM(file_get_contents, len)) {\n             error = ERR_UNSUPPORTED_ENCODING;\n         } else  if (has_utf8_BOM(file_get_contents, len)) {\n             contents.assign(file_get_contents + utf8_BOM_Len, len);        \n-        } else if (!g_locale_to_utf8(file_get_contents, -1, NULL, NULL, &gerror)) {\n-            error = ERR_UNSUPPORTED_ENCODING;\n+        } else if (!g_locale_to_utf8(file_get_contents, -1, NULL, NULL, &gerror) || encoding != \"UTF-8\") {\n+            contents.assign(file_get_contents, len);\n+            std::string detectedCharSet;\n+            try {\n+                if (encoding == \"UTF-8\") {\n+                    GetCharsetMatch(contents.c_str(), contents.size(), detectedCharSet);\n+                }\n+                else {\n+                    detectedCharSet = encoding;\n+                }\n+                std::transform(detectedCharSet.begin(), detectedCharSet.end(), detectedCharSet.begin(), ::toupper);","path":"appshell/appshell_extensions_gtk.cpp","position":86,"original_position":86,"commit_id":"0d30abe8d77d1e8c27da0357223ec71e6f0e8ae1","original_commit_id":"0d30abe8d77d1e8c27da0357223ec71e6f0e8ae1","user":{"login":"abhijitapte","id":2939847,"avatar_url":"https://avatars0.githubusercontent.com/u/2939847?v=3","gravatar_id":"","url":"https://api.github.com/users/abhijitapte","html_url":"https://github.com/abhijitapte","followers_url":"https://api.github.com/users/abhijitapte/followers","following_url":"https://api.github.com/users/abhijitapte/following{/other_user}","gists_url":"https://api.github.com/users/abhijitapte/gists{/gist_id}","starred_url":"https://api.github.com/users/abhijitapte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhijitapte/subscriptions","organizations_url":"https://api.github.com/users/abhijitapte/orgs","repos_url":"https://api.github.com/users/abhijitapte/repos","events_url":"https://api.github.com/users/abhijitapte/events{/privacy}","received_events_url":"https://api.github.com/users/abhijitapte/received_events","type":"User","site_admin":false},"body":"This snippet could be made common across platforms. It will avoid repetition and is a good candidate for refactoring.","created_at":"2017-06-19T11:11:16Z","updated_at":"2017-06-19T11:11:16Z","html_url":"https://github.com/adobe/brackets-shell/pull/604#discussion_r122678989","pull_request_url":"https://api.github.com/repos/adobe/brackets-shell/pulls/604","_links":{"self":{"href":"https://api.github.com/repos/adobe/brackets-shell/pulls/comments/122678989"},"html":{"href":"https://github.com/adobe/brackets-shell/pull/604#discussion_r122678989"},"pull_request":{"href":"https://api.github.com/repos/adobe/brackets-shell/pulls/604"}}},"pull_request":{"url":"https://api.github.com/repos/adobe/brackets-shell/pulls/604","id":123993582,"html_url":"https://github.com/adobe/brackets-shell/pull/604","diff_url":"https://github.com/adobe/brackets-shell/pull/604.diff","patch_url":"https://github.com/adobe/brackets-shell/pull/604.patch","issue_url":"https://api.github.com/repos/adobe/brackets-shell/issues/604","number":604,"state":"open","locked":false,"title":"Saurabh95/linux encoding support","user":{"login":"saurabh95","id":5630113,"avatar_url":"https://avatars1.githubusercontent.com/u/5630113?v=3","gravatar_id":"","url":"https://api.github.com/users/saurabh95","html_url":"https://github.com/saurabh95","followers_url":"https://api.github.com/users/saurabh95/followers","following_url":"https://api.github.com/users/saurabh95/following{/other_user}","gists_url":"https://api.github.com/users/saurabh95/gists{/gist_id}","starred_url":"https://api.github.com/users/saurabh95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saurabh95/subscriptions","organizations_url":"https://api.github.com/users/saurabh95/orgs","repos_url":"https://api.github.com/users/saurabh95/repos","events_url":"https://api.github.com/users/saurabh95/events{/privacy}","received_events_url":"https://api.github.com/users/saurabh95/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-05T14:57:45Z","updated_at":"2017-06-19T11:11:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0918fbdcc050d6dd6f684825002883b51fd836fd","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/adobe/brackets-shell/pulls/604/commits","review_comments_url":"https://api.github.com/repos/adobe/brackets-shell/pulls/604/comments","review_comment_url":"https://api.github.com/repos/adobe/brackets-shell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adobe/brackets-shell/issues/604/comments","statuses_url":"https://api.github.com/repos/adobe/brackets-shell/statuses/0d30abe8d77d1e8c27da0357223ec71e6f0e8ae1","head":{"label":"adobe:saurabh95/LinuxEncodingSupport","ref":"saurabh95/LinuxEncodingSupport","sha":"0d30abe8d77d1e8c27da0357223ec71e6f0e8ae1","user":{"login":"adobe","id":476009,"avatar_url":"https://avatars1.githubusercontent.com/u/476009?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"repo":{"id":4591033,"name":"brackets-shell","full_name":"adobe/brackets-shell","owner":{"login":"adobe","id":476009,"avatar_url":"https://avatars1.githubusercontent.com/u/476009?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adobe/brackets-shell","description":"CEF3-based application shell for Brackets.","fork":false,"url":"https://api.github.com/repos/adobe/brackets-shell","forks_url":"https://api.github.com/repos/adobe/brackets-shell/forks","keys_url":"https://api.github.com/repos/adobe/brackets-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adobe/brackets-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adobe/brackets-shell/teams","hooks_url":"https://api.github.com/repos/adobe/brackets-shell/hooks","issue_events_url":"https://api.github.com/repos/adobe/brackets-shell/issues/events{/number}","events_url":"https://api.github.com/repos/adobe/brackets-shell/events","assignees_url":"https://api.github.com/repos/adobe/brackets-shell/assignees{/user}","branches_url":"https://api.github.com/repos/adobe/brackets-shell/branches{/branch}","tags_url":"https://api.github.com/repos/adobe/brackets-shell/tags","blobs_url":"https://api.github.com/repos/adobe/brackets-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adobe/brackets-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adobe/brackets-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/adobe/brackets-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adobe/brackets-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/adobe/brackets-shell/languages","stargazers_url":"https://api.github.com/repos/adobe/brackets-shell/stargazers","contributors_url":"https://api.github.com/repos/adobe/brackets-shell/contributors","subscribers_url":"https://api.github.com/repos/adobe/brackets-shell/subscribers","subscription_url":"https://api.github.com/repos/adobe/brackets-shell/subscription","commits_url":"https://api.github.com/repos/adobe/brackets-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/adobe/brackets-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/adobe/brackets-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/adobe/brackets-shell/issues/comments{/number}","contents_url":"https://api.github.com/repos/adobe/brackets-shell/contents/{+path}","compare_url":"https://api.github.com/repos/adobe/brackets-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adobe/brackets-shell/merges","archive_url":"https://api.github.com/repos/adobe/brackets-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adobe/brackets-shell/downloads","issues_url":"https://api.github.com/repos/adobe/brackets-shell/issues{/number}","pulls_url":"https://api.github.com/repos/adobe/brackets-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/adobe/brackets-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/adobe/brackets-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adobe/brackets-shell/labels{/name}","releases_url":"https://api.github.com/repos/adobe/brackets-shell/releases{/id}","deployments_url":"https://api.github.com/repos/adobe/brackets-shell/deployments","created_at":"2012-06-07T22:02:06Z","updated_at":"2017-06-19T06:56:55Z","pushed_at":"2017-06-19T10:00:28Z","git_url":"git://github.com/adobe/brackets-shell.git","ssh_url":"git@github.com:adobe/brackets-shell.git","clone_url":"https://github.com/adobe/brackets-shell.git","svn_url":"https://github.com/adobe/brackets-shell","homepage":"http://brackets.io","size":38428,"stargazers_count":1083,"watchers_count":1083,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":627,"mirror_url":null,"open_issues_count":20,"forks":627,"open_issues":20,"watchers":1083,"default_branch":"master"}},"base":{"label":"adobe:linux-1547","ref":"linux-1547","sha":"0873d16efdf6416b55521cf098dc5869bcb854f8","user":{"login":"adobe","id":476009,"avatar_url":"https://avatars1.githubusercontent.com/u/476009?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"repo":{"id":4591033,"name":"brackets-shell","full_name":"adobe/brackets-shell","owner":{"login":"adobe","id":476009,"avatar_url":"https://avatars1.githubusercontent.com/u/476009?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adobe/brackets-shell","description":"CEF3-based application shell for Brackets.","fork":false,"url":"https://api.github.com/repos/adobe/brackets-shell","forks_url":"https://api.github.com/repos/adobe/brackets-shell/forks","keys_url":"https://api.github.com/repos/adobe/brackets-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adobe/brackets-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adobe/brackets-shell/teams","hooks_url":"https://api.github.com/repos/adobe/brackets-shell/hooks","issue_events_url":"https://api.github.com/repos/adobe/brackets-shell/issues/events{/number}","events_url":"https://api.github.com/repos/adobe/brackets-shell/events","assignees_url":"https://api.github.com/repos/adobe/brackets-shell/assignees{/user}","branches_url":"https://api.github.com/repos/adobe/brackets-shell/branches{/branch}","tags_url":"https://api.github.com/repos/adobe/brackets-shell/tags","blobs_url":"https://api.github.com/repos/adobe/brackets-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adobe/brackets-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adobe/brackets-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/adobe/brackets-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adobe/brackets-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/adobe/brackets-shell/languages","stargazers_url":"https://api.github.com/repos/adobe/brackets-shell/stargazers","contributors_url":"https://api.github.com/repos/adobe/brackets-shell/contributors","subscribers_url":"https://api.github.com/repos/adobe/brackets-shell/subscribers","subscription_url":"https://api.github.com/repos/adobe/brackets-shell/subscription","commits_url":"https://api.github.com/repos/adobe/brackets-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/adobe/brackets-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/adobe/brackets-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/adobe/brackets-shell/issues/comments{/number}","contents_url":"https://api.github.com/repos/adobe/brackets-shell/contents/{+path}","compare_url":"https://api.github.com/repos/adobe/brackets-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adobe/brackets-shell/merges","archive_url":"https://api.github.com/repos/adobe/brackets-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adobe/brackets-shell/downloads","issues_url":"https://api.github.com/repos/adobe/brackets-shell/issues{/number}","pulls_url":"https://api.github.com/repos/adobe/brackets-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/adobe/brackets-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/adobe/brackets-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adobe/brackets-shell/labels{/name}","releases_url":"https://api.github.com/repos/adobe/brackets-shell/releases{/id}","deployments_url":"https://api.github.com/repos/adobe/brackets-shell/deployments","created_at":"2012-06-07T22:02:06Z","updated_at":"2017-06-19T06:56:55Z","pushed_at":"2017-06-19T10:00:28Z","git_url":"git://github.com/adobe/brackets-shell.git","ssh_url":"git@github.com:adobe/brackets-shell.git","clone_url":"https://github.com/adobe/brackets-shell.git","svn_url":"https://github.com/adobe/brackets-shell","homepage":"http://brackets.io","size":38428,"stargazers_count":1083,"watchers_count":1083,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":627,"mirror_url":null,"open_issues_count":20,"forks":627,"open_issues":20,"watchers":1083,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adobe/brackets-shell/pulls/604"},"html":{"href":"https://github.com/adobe/brackets-shell/pull/604"},"issue":{"href":"https://api.github.com/repos/adobe/brackets-shell/issues/604"},"comments":{"href":"https://api.github.com/repos/adobe/brackets-shell/issues/604/comments"},"review_comments":{"href":"https://api.github.com/repos/adobe/brackets-shell/pulls/604/comments"},"review_comment":{"href":"https://api.github.com/repos/adobe/brackets-shell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adobe/brackets-shell/pulls/604/commits"},"statuses":{"href":"https://api.github.com/repos/adobe/brackets-shell/statuses/0d30abe8d77d1e8c27da0357223ec71e6f0e8ae1"}}}}
{"actor":{"display_login":"abhijitapte"}}