Skip to content

Instantly share code, notes, and snippets.

@joker1007
Created September 10, 2011 06:29
Show Gist options
  • Save joker1007/1208014 to your computer and use it in GitHub Desktop.
Save joker1007/1208014 to your computer and use it in GitHub Desktop.
class MyParser
def self.parse(thing, url = nil, encoding = nil,
options = Nokogiri::XML::ParseOptions::DEFAULT_HTML, &block)
thing=NKF.nkf("-wm0E", thing).sub(/euc-jp/, "utf-8")
Nokogiri::HTML::Document.parse(thing, url, encoding, options, &block)
end
end
# vim:ft=ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment