{"action":"created","comment":{"url":"https://api.github.com/repos/rack/rack/pulls/comments/183427487","pull_request_review_id":114423260,"id":183427487,"diff_hunk":"@@ -34,7 +34,7 @@ class Builder\n     def self.parse_file(config, opts = Server::Options.new)\n       options = {}\n       if config =~ /\\.ru$/\n-        cfgfile = ::File.read(config)\n+        cfgfile = ::File.read(config, mode: 'r:bom|utf-8')","path":"lib/rack/builder.rb","position":5,"original_position":5,"commit_id":"7583330b318e592f6df3dc6f8a7131bcd0613a5a","original_commit_id":"7583330b318e592f6df3dc6f8a7131bcd0613a5a","user":{"login":"mikegee","id":14068,"avatar_url":"https://avatars3.githubusercontent.com/u/14068?v=4","gravatar_id":"","url":"https://api.github.com/users/mikegee","html_url":"https://github.com/mikegee","followers_url":"https://api.github.com/users/mikegee/followers","following_url":"https://api.github.com/users/mikegee/following{/other_user}","gists_url":"https://api.github.com/users/mikegee/gists{/gist_id}","starred_url":"https://api.github.com/users/mikegee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikegee/subscriptions","organizations_url":"https://api.github.com/users/mikegee/orgs","repos_url":"https://api.github.com/users/mikegee/repos","events_url":"https://api.github.com/users/mikegee/events{/privacy}","received_events_url":"https://api.github.com/users/mikegee/received_events","type":"User","site_admin":false},"body":"Thanks again, @manveru. I think I've got it now. \r\n\r\nI was able to create a CP1252 `config.ru` with some accented characters and it worked as expected. Assuming `config.ru` is UTF-8 would be a breaking change.\r\n\r\n----\r\n\r\nRegarding the issue this PR is meant to solve, how do you feel about a solution like:\r\n\r\n- if the string encoding is UTF-8 after reading the file,\r\n- strip the BOM with `String` methods or a regexp\r\n\r\n?","created_at":"2018-04-23T15:00:54Z","updated_at":"2018-04-23T15:00:55Z","html_url":"https://github.com/rack/rack/pull/1252#discussion_r183427487","pull_request_url":"https://api.github.com/repos/rack/rack/pulls/1252","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rack/rack/pulls/comments/183427487"},"html":{"href":"https://github.com/rack/rack/pull/1252#discussion_r183427487"},"pull_request":{"href":"https://api.github.com/repos/rack/rack/pulls/1252"}},"in_reply_to_id":181945703},"pull_request":{"url":"https://api.github.com/repos/rack/rack/pulls/1252","id":181729195,"html_url":"https://github.com/rack/rack/pull/1252","diff_url":"https://github.com/rack/rack/pull/1252.diff","patch_url":"https://github.com/rack/rack/pull/1252.patch","issue_url":"https://api.github.com/repos/rack/rack/issues/1252","number":1252,"state":"open","locked":false,"title":"Support unicode byte order mark in config.ru","user":{"login":"mikegee","id":14068,"avatar_url":"https://avatars3.githubusercontent.com/u/14068?v=4","gravatar_id":"","url":"https://api.github.com/users/mikegee","html_url":"https://github.com/mikegee","followers_url":"https://api.github.com/users/mikegee/followers","following_url":"https://api.github.com/users/mikegee/following{/other_user}","gists_url":"https://api.github.com/users/mikegee/gists{/gist_id}","starred_url":"https://api.github.com/users/mikegee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikegee/subscriptions","organizations_url":"https://api.github.com/users/mikegee/orgs","repos_url":"https://api.github.com/users/mikegee/repos","events_url":"https://api.github.com/users/mikegee/events{/privacy}","received_events_url":"https://api.github.com/users/mikegee/received_events","type":"User","site_admin":false},"body":"fixes #1021","created_at":"2018-04-16T00:01:39Z","updated_at":"2018-04-23T15:00:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7f39aa6cdf7fb61875fef14313087aae65f449a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rack/rack/pulls/1252/commits","review_comments_url":"https://api.github.com/repos/rack/rack/pulls/1252/comments","review_comment_url":"https://api.github.com/repos/rack/rack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rack/rack/issues/1252/comments","statuses_url":"https://api.github.com/repos/rack/rack/statuses/7583330b318e592f6df3dc6f8a7131bcd0613a5a","head":{"label":"mikegee:fix-1021-unicode-bom-in-configru","ref":"fix-1021-unicode-bom-in-configru","sha":"7583330b318e592f6df3dc6f8a7131bcd0613a5a","user":{"login":"mikegee","id":14068,"avatar_url":"https://avatars3.githubusercontent.com/u/14068?v=4","gravatar_id":"","url":"https://api.github.com/users/mikegee","html_url":"https://github.com/mikegee","followers_url":"https://api.github.com/users/mikegee/followers","following_url":"https://api.github.com/users/mikegee/following{/other_user}","gists_url":"https://api.github.com/users/mikegee/gists{/gist_id}","starred_url":"https://api.github.com/users/mikegee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikegee/subscriptions","organizations_url":"https://api.github.com/users/mikegee/orgs","repos_url":"https://api.github.com/users/mikegee/repos","events_url":"https://api.github.com/users/mikegee/events{/privacy}","received_events_url":"https://api.github.com/users/mikegee/received_events","type":"User","site_admin":false},"repo":{"id":129654240,"name":"rack","full_name":"mikegee/rack","owner":{"login":"mikegee","id":14068,"avatar_url":"https://avatars3.githubusercontent.com/u/14068?v=4","gravatar_id":"","url":"https://api.github.com/users/mikegee","html_url":"https://github.com/mikegee","followers_url":"https://api.github.com/users/mikegee/followers","following_url":"https://api.github.com/users/mikegee/following{/other_user}","gists_url":"https://api.github.com/users/mikegee/gists{/gist_id}","starred_url":"https://api.github.com/users/mikegee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikegee/subscriptions","organizations_url":"https://api.github.com/users/mikegee/orgs","repos_url":"https://api.github.com/users/mikegee/repos","events_url":"https://api.github.com/users/mikegee/events{/privacy}","received_events_url":"https://api.github.com/users/mikegee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikegee/rack","description":"a modular Ruby webserver interface","fork":true,"url":"https://api.github.com/repos/mikegee/rack","forks_url":"https://api.github.com/repos/mikegee/rack/forks","keys_url":"https://api.github.com/repos/mikegee/rack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikegee/rack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikegee/rack/teams","hooks_url":"https://api.github.com/repos/mikegee/rack/hooks","issue_events_url":"https://api.github.com/repos/mikegee/rack/issues/events{/number}","events_url":"https://api.github.com/repos/mikegee/rack/events","assignees_url":"https://api.github.com/repos/mikegee/rack/assignees{/user}","branches_url":"https://api.github.com/repos/mikegee/rack/branches{/branch}","tags_url":"https://api.github.com/repos/mikegee/rack/tags","blobs_url":"https://api.github.com/repos/mikegee/rack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikegee/rack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikegee/rack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikegee/rack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikegee/rack/statuses/{sha}","languages_url":"https://api.github.com/repos/mikegee/rack/languages","stargazers_url":"https://api.github.com/repos/mikegee/rack/stargazers","contributors_url":"https://api.github.com/repos/mikegee/rack/contributors","subscribers_url":"https://api.github.com/repos/mikegee/rack/subscribers","subscription_url":"https://api.github.com/repos/mikegee/rack/subscription","commits_url":"https://api.github.com/repos/mikegee/rack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikegee/rack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikegee/rack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikegee/rack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikegee/rack/contents/{+path}","compare_url":"https://api.github.com/repos/mikegee/rack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikegee/rack/merges","archive_url":"https://api.github.com/repos/mikegee/rack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikegee/rack/downloads","issues_url":"https://api.github.com/repos/mikegee/rack/issues{/number}","pulls_url":"https://api.github.com/repos/mikegee/rack/pulls{/number}","milestones_url":"https://api.github.com/repos/mikegee/rack/milestones{/number}","notifications_url":"https://api.github.com/repos/mikegee/rack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikegee/rack/labels{/name}","releases_url":"https://api.github.com/repos/mikegee/rack/releases{/id}","deployments_url":"https://api.github.com/repos/mikegee/rack/deployments","created_at":"2018-04-15T21:54:21Z","updated_at":"2018-04-15T21:54:23Z","pushed_at":"2018-04-16T00:05:53Z","git_url":"git://github.com/mikegee/rack.git","ssh_url":"git@github.com:mikegee/rack.git","clone_url":"https://github.com/mikegee/rack.git","svn_url":"https://github.com/mikegee/rack","homepage":"http://rack.github.io/","size":3322,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rack:master","ref":"master","sha":"d8d688164f4ec316b1e18e3b63090df9450aa8d5","user":{"login":"rack","id":42379,"avatar_url":"https://avatars3.githubusercontent.com/u/42379?v=4","gravatar_id":"","url":"https://api.github.com/users/rack","html_url":"https://github.com/rack","followers_url":"https://api.github.com/users/rack/followers","following_url":"https://api.github.com/users/rack/following{/other_user}","gists_url":"https://api.github.com/users/rack/gists{/gist_id}","starred_url":"https://api.github.com/users/rack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rack/subscriptions","organizations_url":"https://api.github.com/users/rack/orgs","repos_url":"https://api.github.com/users/rack/repos","events_url":"https://api.github.com/users/rack/events{/privacy}","received_events_url":"https://api.github.com/users/rack/received_events","type":"Organization","site_admin":false},"repo":{"id":96071,"name":"rack","full_name":"rack/rack","owner":{"login":"rack","id":42379,"avatar_url":"https://avatars3.githubusercontent.com/u/42379?v=4","gravatar_id":"","url":"https://api.github.com/users/rack","html_url":"https://github.com/rack","followers_url":"https://api.github.com/users/rack/followers","following_url":"https://api.github.com/users/rack/following{/other_user}","gists_url":"https://api.github.com/users/rack/gists{/gist_id}","starred_url":"https://api.github.com/users/rack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rack/subscriptions","organizations_url":"https://api.github.com/users/rack/orgs","repos_url":"https://api.github.com/users/rack/repos","events_url":"https://api.github.com/users/rack/events{/privacy}","received_events_url":"https://api.github.com/users/rack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rack/rack","description":"a modular Ruby webserver interface","fork":false,"url":"https://api.github.com/repos/rack/rack","forks_url":"https://api.github.com/repos/rack/rack/forks","keys_url":"https://api.github.com/repos/rack/rack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rack/rack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rack/rack/teams","hooks_url":"https://api.github.com/repos/rack/rack/hooks","issue_events_url":"https://api.github.com/repos/rack/rack/issues/events{/number}","events_url":"https://api.github.com/repos/rack/rack/events","assignees_url":"https://api.github.com/repos/rack/rack/assignees{/user}","branches_url":"https://api.github.com/repos/rack/rack/branches{/branch}","tags_url":"https://api.github.com/repos/rack/rack/tags","blobs_url":"https://api.github.com/repos/rack/rack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rack/rack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rack/rack/git/refs{/sha}","trees_url":"https://api.github.com/repos/rack/rack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rack/rack/statuses/{sha}","languages_url":"https://api.github.com/repos/rack/rack/languages","stargazers_url":"https://api.github.com/repos/rack/rack/stargazers","contributors_url":"https://api.github.com/repos/rack/rack/contributors","subscribers_url":"https://api.github.com/repos/rack/rack/subscribers","subscription_url":"https://api.github.com/repos/rack/rack/subscription","commits_url":"https://api.github.com/repos/rack/rack/commits{/sha}","git_commits_url":"https://api.github.com/repos/rack/rack/git/commits{/sha}","comments_url":"https://api.github.com/repos/rack/rack/comments{/number}","issue_comment_url":"https://api.github.com/repos/rack/rack/issues/comments{/number}","contents_url":"https://api.github.com/repos/rack/rack/contents/{+path}","compare_url":"https://api.github.com/repos/rack/rack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rack/rack/merges","archive_url":"https://api.github.com/repos/rack/rack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rack/rack/downloads","issues_url":"https://api.github.com/repos/rack/rack/issues{/number}","pulls_url":"https://api.github.com/repos/rack/rack/pulls{/number}","milestones_url":"https://api.github.com/repos/rack/rack/milestones{/number}","notifications_url":"https://api.github.com/repos/rack/rack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rack/rack/labels{/name}","releases_url":"https://api.github.com/repos/rack/rack/releases{/id}","deployments_url":"https://api.github.com/repos/rack/rack/deployments","created_at":"2008-12-24T03:03:12Z","updated_at":"2018-04-22T11:50:01Z","pushed_at":"2018-04-19T17:27:11Z","git_url":"git://github.com/rack/rack.git","ssh_url":"git@github.com:rack/rack.git","clone_url":"https://github.com/rack/rack.git","svn_url":"https://github.com/rack/rack","homepage":"http://rack.github.io/","size":3367,"stargazers_count":3343,"watchers_count":3343,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1257,"mirror_url":null,"archived":false,"open_issues_count":171,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1257,"open_issues":171,"watchers":3343,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rack/rack/pulls/1252"},"html":{"href":"https://github.com/rack/rack/pull/1252"},"issue":{"href":"https://api.github.com/repos/rack/rack/issues/1252"},"comments":{"href":"https://api.github.com/repos/rack/rack/issues/1252/comments"},"review_comments":{"href":"https://api.github.com/repos/rack/rack/pulls/1252/comments"},"review_comment":{"href":"https://api.github.com/repos/rack/rack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rack/rack/pulls/1252/commits"},"statuses":{"href":"https://api.github.com/repos/rack/rack/statuses/7583330b318e592f6df3dc6f8a7131bcd0613a5a"}},"author_association":"NONE"}}
{"actor":{"display_login":"mikegee"}}