From 46ff009168cfb29b473bc37d38b64719ad9e6526 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 14 Apr 2010 13:11:11 +0000 Subject: * lib/rexml/source.rb: force_encoding("UTF-8") when the input is already UTF-8. patched by Kouhei Sutou [ruby-core:23404] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rexml/test_document.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/rexml/test_document.rb') diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb index 1ee1a1d414..ab0b1e4e96 100644 --- a/test/rexml/test_document.rb +++ b/test/rexml/test_document.rb @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + require "rexml/document" require "test/unit" @@ -83,6 +85,18 @@ EOF REXML::Document.entity_expansion_limit = 10000 end + def test_tag_in_cdata_with_not_ascii_only_but_ascii8bit_encoding_source + tag = "..." + message = "こんにちは、世界!" # Hello world! in Japanese + xml = < + +EOX + xml.force_encoding(Encoding::ASCII_8BIT) + doc = REXML::Document.new(xml) + assert_equal("#{tag}#{message}", doc.root.children.first.value) + end + def test_xml_declaration_standalone bug2539 = '[ruby-core:27345]' doc = REXML::Document.new('') -- cgit v1.2.3