summaryrefslogtreecommitdiff
path: root/lib/rexml
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-03 03:41:26 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-03 03:41:26 +0000
commit69eedf6a18d0c21b06d30ec4bc4a550d4ac125dd (patch)
tree66d0a13000e00d69d5ab64598d99f4230a43fa88 /lib/rexml
parentc032c5bc9acb015dbe2947a39d3d7ce033c934ee (diff)
* lib/rexml/xmldecl.rb (REXML::XMLDecl): Stop using REXML::Encoding
module because XMLDecl doesn't convert encoding. This causes removing XML encoding name normalization (encoding.upcase). Encoding name in XML declaration is what user specifies. I think this is reasonable change. * test/rexml/test_xml_declaration.rb: Add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r--lib/rexml/xmldecl.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/rexml/xmldecl.rb b/lib/rexml/xmldecl.rb
index 361e4b7..6b48a6f 100644
--- a/lib/rexml/xmldecl.rb
+++ b/lib/rexml/xmldecl.rb
@@ -4,8 +4,6 @@ require 'rexml/source'
module REXML
# NEEDS DOCUMENTATION
class XMLDecl < Child
- include Encoding
-
DEFAULT_VERSION = "1.0";
DEFAULT_ENCODING = "UTF-8";
DEFAULT_STANDALONE = "no";
@@ -13,7 +11,7 @@ module REXML
STOP = '\?>';
attr_accessor :version, :standalone
- attr_reader :writeencoding, :writethis
+ attr_reader :encoding, :writeencoding, :writethis
def initialize(version=DEFAULT_VERSION, encoding=nil, standalone=nil)
@writethis = true
@@ -57,7 +55,7 @@ module REXML
def ==( other )
other.kind_of?(XMLDecl) and
other.version == @version and
- other.encoding == self.encoding and
+ other.encoding.upcase == self.encoding.upcase and
other.standalone == @standalone
end
@@ -72,14 +70,13 @@ module REXML
end
alias :stand_alone? :standalone
- alias :old_enc= :encoding=
def encoding=( enc )
if enc.nil?
- self.old_enc = "UTF-8"
+ @encoding = "UTF-8"
@writeencoding = false
else
- self.old_enc = enc
+ @encoding = enc
@writeencoding = true
end
self.dowrite