mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rexml/source.rb (REXML::IOSource#encoding_updated): Fix a
bug that can't parse XML correctly when Encoding.default_internal is different with XML encoding. REXML::Source converts XML encoding on read. So IO should not convert XML encoding. Based on patch by NAKAMURA Usaku. [ruby-dev:48686] [Bug #10418] * test/rexml/test_encoding.rb (REXMLTests::EncodingTester#test_parse_utf16_with_utf8_default_internal): Add the for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f6c56982ab
commit
93647e81a6
3 changed files with 24 additions and 1 deletions
|
@ -285,7 +285,7 @@ module REXML
|
|||
case @encoding
|
||||
when "UTF-16BE", "UTF-16LE"
|
||||
@source.binmode
|
||||
@source.set_encoding(@encoding)
|
||||
@source.set_encoding(@encoding, @encoding)
|
||||
end
|
||||
@line_break = encode(">")
|
||||
@pending_buffer, @buffer = @buffer, ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue