class Nokogiri::XML::SAX::ParserContext

def self.new(thing, encoding = "UTF-8")

def self.new(thing, encoding = "UTF-8")
  if [:read, :close].all? { |x| thing.respond_to?(x) }
    io(thing, Parser::ENCODINGS[encoding])
  else
    memory(thing)
  end
end