{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/comments/25813494","id":25813494,"diff_hunk":"@@ -441,6 +441,10 @@ def test_x03a_legitimate\n     assert_sanitized %(<a href=\"http&#x3A;//legit\">), %(<a href=\"http://legit\">)\n   end\n \n+  def test_sanitize_ascii_8bit_string\n+    assert_equal '<a>hello</a>', white_list_sanitize('<a>hello</a>'.encode('ASCII-8BIT'))","path":"test/sanitizer_test.rb","position":5,"original_position":5,"commit_id":"f3d1e7b05519a16bf9980caea876bc892633e837","original_commit_id":"f3d1e7b05519a16bf9980caea876bc892633e837","user":{"login":"rafaelfranca","id":47848,"avatar_url":"https://avatars.githubusercontent.com/u/47848?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"body":"Should we assert the result encoding?","created_at":"2015-03-04T21:02:27Z","updated_at":"2015-03-04T21:02:27Z","html_url":"https://github.com/rails/rails-html-sanitizer/pull/34#discussion_r25813494","pull_request_url":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/comments/25813494"},"html":{"href":"https://github.com/rails/rails-html-sanitizer/pull/34#discussion_r25813494"},"pull_request":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/34","id":30503891,"html_url":"https://github.com/rails/rails-html-sanitizer/pull/34","diff_url":"https://github.com/rails/rails-html-sanitizer/pull/34.diff","patch_url":"https://github.com/rails/rails-html-sanitizer/pull/34.patch","issue_url":"https://api.github.com/repos/rails/rails-html-sanitizer/issues/34","number":34,"state":"open","locked":false,"title":"Prevent \"unknown encoding: ASCII-8BIT\" errors","user":{"login":"kaspth","id":350807,"avatar_url":"https://avatars.githubusercontent.com/u/350807?v=3","gravatar_id":"","url":"https://api.github.com/users/kaspth","html_url":"https://github.com/kaspth","followers_url":"https://api.github.com/users/kaspth/followers","following_url":"https://api.github.com/users/kaspth/following{/other_user}","gists_url":"https://api.github.com/users/kaspth/gists{/gist_id}","starred_url":"https://api.github.com/users/kaspth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaspth/subscriptions","organizations_url":"https://api.github.com/users/kaspth/orgs","repos_url":"https://api.github.com/users/kaspth/repos","events_url":"https://api.github.com/users/kaspth/events{/privacy}","received_events_url":"https://api.github.com/users/kaspth/received_events","type":"User","site_admin":false},"body":"Fixes #30\r\n\r\nNokogiri would throw these errors when outputting the fragment with #to_s.\r\nInstead call the format serializers directly and pass a UTF-8 encoding.\r\n\r\ncc @rafaelfranca @kindjar @ncri @Junichilto","created_at":"2015-03-04T21:00:36Z","updated_at":"2015-03-04T21:02:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e4c586d6553fef5017300935369bfec98ffd87a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/34/commits","review_comments_url":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/34/comments","review_comment_url":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails-html-sanitizer/issues/34/comments","statuses_url":"https://api.github.com/repos/rails/rails-html-sanitizer/statuses/f3d1e7b05519a16bf9980caea876bc892633e837","head":{"label":"rails:accept-ascii-8bit-strings","ref":"accept-ascii-8bit-strings","sha":"f3d1e7b05519a16bf9980caea876bc892633e837","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":13080550,"name":"rails-html-sanitizer","full_name":"rails/rails-html-sanitizer","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails-html-sanitizer","description":"","fork":false,"url":"https://api.github.com/repos/rails/rails-html-sanitizer","forks_url":"https://api.github.com/repos/rails/rails-html-sanitizer/forks","keys_url":"https://api.github.com/repos/rails/rails-html-sanitizer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails-html-sanitizer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails-html-sanitizer/teams","hooks_url":"https://api.github.com/repos/rails/rails-html-sanitizer/hooks","issue_events_url":"https://api.github.com/repos/rails/rails-html-sanitizer/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails-html-sanitizer/events","assignees_url":"https://api.github.com/repos/rails/rails-html-sanitizer/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails-html-sanitizer/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails-html-sanitizer/tags","blobs_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails-html-sanitizer/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails-html-sanitizer/languages","stargazers_url":"https://api.github.com/repos/rails/rails-html-sanitizer/stargazers","contributors_url":"https://api.github.com/repos/rails/rails-html-sanitizer/contributors","subscribers_url":"https://api.github.com/repos/rails/rails-html-sanitizer/subscribers","subscription_url":"https://api.github.com/repos/rails/rails-html-sanitizer/subscription","commits_url":"https://api.github.com/repos/rails/rails-html-sanitizer/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails-html-sanitizer/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails-html-sanitizer/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails-html-sanitizer/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails-html-sanitizer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails-html-sanitizer/merges","archive_url":"https://api.github.com/repos/rails/rails-html-sanitizer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails-html-sanitizer/downloads","issues_url":"https://api.github.com/repos/rails/rails-html-sanitizer/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails-html-sanitizer/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails-html-sanitizer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails-html-sanitizer/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails-html-sanitizer/releases{/id}","created_at":"2013-09-25T00:54:20Z","updated_at":"2015-02-09T18:15:11Z","pushed_at":"2015-03-04T20:58:43Z","git_url":"git://github.com/rails/rails-html-sanitizer.git","ssh_url":"git@github.com:rails/rails-html-sanitizer.git","clone_url":"https://github.com/rails/rails-html-sanitizer.git","svn_url":"https://github.com/rails/rails-html-sanitizer","homepage":null,"size":577,"stargazers_count":40,"watchers_count":40,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":6,"forks":7,"open_issues":6,"watchers":40,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"1206877e9560701835f55bb2a671483b370d9ac3","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":13080550,"name":"rails-html-sanitizer","full_name":"rails/rails-html-sanitizer","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails-html-sanitizer","description":"","fork":false,"url":"https://api.github.com/repos/rails/rails-html-sanitizer","forks_url":"https://api.github.com/repos/rails/rails-html-sanitizer/forks","keys_url":"https://api.github.com/repos/rails/rails-html-sanitizer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails-html-sanitizer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails-html-sanitizer/teams","hooks_url":"https://api.github.com/repos/rails/rails-html-sanitizer/hooks","issue_events_url":"https://api.github.com/repos/rails/rails-html-sanitizer/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails-html-sanitizer/events","assignees_url":"https://api.github.com/repos/rails/rails-html-sanitizer/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails-html-sanitizer/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails-html-sanitizer/tags","blobs_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails-html-sanitizer/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails-html-sanitizer/languages","stargazers_url":"https://api.github.com/repos/rails/rails-html-sanitizer/stargazers","contributors_url":"https://api.github.com/repos/rails/rails-html-sanitizer/contributors","subscribers_url":"https://api.github.com/repos/rails/rails-html-sanitizer/subscribers","subscription_url":"https://api.github.com/repos/rails/rails-html-sanitizer/subscription","commits_url":"https://api.github.com/repos/rails/rails-html-sanitizer/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails-html-sanitizer/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails-html-sanitizer/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails-html-sanitizer/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails-html-sanitizer/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails-html-sanitizer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails-html-sanitizer/merges","archive_url":"https://api.github.com/repos/rails/rails-html-sanitizer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails-html-sanitizer/downloads","issues_url":"https://api.github.com/repos/rails/rails-html-sanitizer/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails-html-sanitizer/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails-html-sanitizer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails-html-sanitizer/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails-html-sanitizer/releases{/id}","created_at":"2013-09-25T00:54:20Z","updated_at":"2015-02-09T18:15:11Z","pushed_at":"2015-03-04T20:58:43Z","git_url":"git://github.com/rails/rails-html-sanitizer.git","ssh_url":"git@github.com:rails/rails-html-sanitizer.git","clone_url":"https://github.com/rails/rails-html-sanitizer.git","svn_url":"https://github.com/rails/rails-html-sanitizer","homepage":null,"size":577,"stargazers_count":40,"watchers_count":40,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":6,"forks":7,"open_issues":6,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/34"},"html":{"href":"https://github.com/rails/rails-html-sanitizer/pull/34"},"issue":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/issues/34"},"comments":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails-html-sanitizer/statuses/f3d1e7b05519a16bf9980caea876bc892633e837"}}}}