diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-01 05:43:50 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-01 05:43:50 +0000 |
commit | 1448668244c81cfc720bcdfa93af352a17cc230f (patch) | |
tree | 550af4707b22d099f4d8393e29ef6da424aca813 /lib/rexml/parsers/baseparser.rb | |
parent | 96e7713754c477fe98806b905301356371accb68 (diff) | |
download | ruby-1448668244c81cfc720bcdfa93af352a17cc230f.tar.gz |
* lib/rexml: 1.9 patch from Sam Ruby mentioned in his blog:
<http://intertwingly.net/blog/2007/12/31/Porting-REXML-to-Ruby-1-9>
[ruby-core:14639]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/parsers/baseparser.rb')
-rw-r--r-- | lib/rexml/parsers/baseparser.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb index fc2354a67f..854e707fae 100644 --- a/lib/rexml/parsers/baseparser.rb +++ b/lib/rexml/parsers/baseparser.rb @@ -242,6 +242,11 @@ 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 + end end end if @document_status == :in_doctype |