Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Auto-convert all mechanize pages to UTF-8
class Mechanize
alias_method :original_get, :get
def get *args
doc = original_get *args
encoding = doc.encodings.last
doc.content.encode!('UTF-8', encoding)
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.