1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rexml/encoding.rb (REXML::Encoding::check_encoding): spaces

are allowed around equal sign.  [ruby-core:09032]

* lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2006-10-09 14:00:59 +00:00
parent bd62057a8b
commit c009be97e8
3 changed files with 10 additions and 3 deletions

View file

@ -58,7 +58,7 @@ module REXML
# We have to recognize UTF-16, LSB UTF-16, and UTF-8
return UTF_16 if /\A\xfe\xff/n =~ str
return UNILE if /\A\xff\xfe/n =~ str
str =~ /^\s*<?xml\s*version=(['"]).*?\2\s*encoding=(["'])(.*?)\2/um
str =~ /^\s*<?xml\s*version\s*=\s*(['"]).*?\2\s*encoding\s*=\s*(["'])(.*?)\2/um
return $1.upcase if $1
return UTF_8
end