diff options
Diffstat (limited to 'lib/rexml')
-rw-r--r-- | lib/rexml/xmldecl.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/rexml/xmldecl.rb b/lib/rexml/xmldecl.rb index 361e4b7106..6b48a6f8ea 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 |