Skip to content

Commit

Permalink
wip: try to get weird encoding failure to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Dec 29, 2023
1 parent 245cc78 commit 5a03a3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/mechanize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
require 'webrick/httputils'
require 'zlib'

Nokogiri::EncodingHandler.alias("UTF-8", "UTF8")

##
# The Mechanize library is used for automating interactions with a website. It
# can follow links and submit forms. Form fields can be populated and
Expand Down
4 changes: 2 additions & 2 deletions test/test_mechanize_http_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1309,8 +1309,8 @@ def test_response_parse_content_type_encoding_broken_utf_8
page = @agent.response_parse @res, body, @uri

assert_instance_of Mechanize::Page, page
assert_equal 'UTF8', page.encoding
assert_equal 'UTF8', page.parser.encoding
assert_equal 'UTF-8', page.encoding
assert_equal 'UTF-8', page.parser.encoding
end

def test_response_parse_content_type_encoding_garbage
Expand Down

0 comments on commit 5a03a3d

Please sign in to comment.