aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml/parsers/baseparser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/parsers/baseparser.rb')
-rw-r--r--lib/rexml/parsers/baseparser.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb
index ade35d7921..ee8b160ce5 100644
--- a/lib/rexml/parsers/baseparser.rb
+++ b/lib/rexml/parsers/baseparser.rb
@@ -248,10 +248,8 @@ module REXML
@document_status = :after_doctype
@source.read if @source.buffer.size<2
md = @source.match(/\s*/um, true)
- if @source.encoding == "UTF-8"
- if @source.buffer.respond_to? :force_encoding
- @source.buffer.force_encoding(Encoding::UTF_8)
- end
+ if @source.encoding == ::Encoding::UTF_8
+ @source.buffer.force_encoding(::Encoding::UTF_8)
end
end
end