Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Auto-convert all mechanize pages to UTF-8

View mechanize_auto_utf8.rb
1 2 3 4 5 6 7 8 9
class Mechanize
alias_method :original_get, :get
def get *args
doc = original_get *args
encoding = doc.encodings.last
doc.content.encode!('UTF-8', encoding)
doc
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.