Sha256: 27413dfcd380990f86db503df2591b0d978c57f72b81c8afdf171ff5afa2bd67
Contents?: true
Size: 711 Bytes
Versions: 339
Compression:
Stored size: 711 Bytes
Contents
# -*- coding: utf-8 -*- require "helper" module Nokogiri module HTML if RUBY_VERSION =~ /^1\.9/ class TestNodeEncoding < Nokogiri::TestCase def test_inner_html doc = Nokogiri::HTML File.open(SHIFT_JIS_HTML, 'rb') hello = "こんにちは" contents = doc.at('h2').inner_html assert_equal doc.encoding, contents.encoding.name assert_match hello.encode('Shift_JIS'), contents contents = doc.at('h2').inner_html(:encoding => 'UTF-8') assert_match hello, contents doc.encoding = 'UTF-8' contents = doc.at('h2').inner_html assert_match hello, contents end end end end end
Version data entries
339 entries across 339 versions & 33 rubygems