M
Michel Demazure
According to Nokogiri's doc, it works internally in UTF-8.
Running this :
# encoding: utf-8
require 'nokogiri'
class MyDoc < Nokogiri::XML::SAX:ocument
def characters(string)
puts string.encoding
puts string
end
end
puts RUBY_VERSION
puts Encoding.default_external
parser = Nokogiri::XML::SAX:arser.new(MyDoc.new, 'UTF-8')
parser.parse('<foo>épée</foo>')
gives :
1.9.2
UTF-8
UTF-8
épée
Why ?
_md
Running this :
# encoding: utf-8
require 'nokogiri'
class MyDoc < Nokogiri::XML::SAX:ocument
def characters(string)
puts string.encoding
puts string
end
end
puts RUBY_VERSION
puts Encoding.default_external
parser = Nokogiri::XML::SAX:arser.new(MyDoc.new, 'UTF-8')
parser.parse('<foo>épée</foo>')
gives :
1.9.2
UTF-8
UTF-8
épée
Why ?
_md