diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-02 15:36:48 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-02 15:36:48 +0000 |
commit | f25ff846f6884e202d13ab28e3e10c917b9cdf31 (patch) | |
tree | 1912c745ed74d061e3213706184d63af6d7963a1 /lib/rexml/source.rb | |
parent | cddcffb8f9dd015650b2ac02235bfe39261989f9 (diff) | |
download | ruby-f25ff846f6884e202d13ab28e3e10c917b9cdf31.tar.gz |
* lib/rexml/encoding.rb (REXML::Encoding#encoding=): store @encoding
a String which means the name of the encoding.
this partially revert r29646.
* lib/rexml/document.rb: follow above.
* lib/rexml/output.rb: ditto.
* lib/rexml/parsers/baseparser.rb: ditto.
* lib/rexml/source.rb: ditto.
* lib/rexml/xmldecl.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/source.rb')
-rw-r--r-- | lib/rexml/source.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/rexml/source.rb b/lib/rexml/source.rb index 227b0c56c4..112393cfd4 100644 --- a/lib/rexml/source.rb +++ b/lib/rexml/source.rb @@ -54,14 +54,12 @@ module REXML def encoding=(enc) return unless super @line_break = encode( '>' ) - if @encoding != ::Encoding::UTF_8 + if @encoding != 'UTF-8' @buffer = decode(@buffer) @to_utf = true else @to_utf = false - if @buffer.respond_to? :force_encoding - @buffer.force_encoding ::Encoding::UTF_8 - end + @buffer.force_encoding ::Encoding::UTF_8 end end |