Actions
Bug #1449
closed[REXML] detected encoding isn't used correctly
Description
=begin
REXML::Source can detect source encoding by XML declaration. REXML::IOSource can also detect it but it's not used correctly.
REXML::IOSource uses detected encoding to convert read data from @source. If detected encoding is UTF-8 read data isn't converted. (ref. rexml/encodings/UTF-8.rb) If detected encoding is UTF-8 but @source.external_encoding isn't UTF-8, it may cause a problem.
If @source.external_encoding is ASCII-8BIT and @source only has ASCII data, it doesn't cause any problems. If @source.external_encoding is ASCII-8BIT and @source has non-ASCII data, it causes a problem. In the case, "@buffer << read_data_from_source" causes an Encoding::CompatibilityError. It breaks correct XML parsing.
=end
Files
Actions
Like0
Like0Like0