diff options
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 |