diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-03 03:53:09 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-03 03:53:09 +0000 |
commit | 3f817764e24eb05aceef884e213d4a7043c292fa (patch) | |
tree | 165579f07248ac404674563c5fc9d1bfec863683 /lib/rexml/xmldecl.rb | |
parent | 69eedf6a18d0c21b06d30ec4bc4a550d4ac125dd (diff) |
* lib/rexml/document.rb (REXML::Document#write): Document encoding
option. Now different encoding between XML file's encoding and
XML declaration's encodiong is support.
[Feature #4872] (work in progress)
* lib/rexml/xmldecl.rb (REXML::XMLDecl#write): Always use XMLDecl's
encoding.
* test/rexml/test_document.rb: Update tests for the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/xmldecl.rb')
-rw-r--r-- | lib/rexml/xmldecl.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/rexml/xmldecl.rb b/lib/rexml/xmldecl.rb index 6b48a6f8ea..783c9233dc 100644 --- a/lib/rexml/xmldecl.rb +++ b/lib/rexml/xmldecl.rb @@ -44,11 +44,7 @@ module REXML def write(writer, indent=-1, transitive=false, ie_hack=false) return nil unless @writethis or writer.kind_of? Output writer << START.sub(/\\/u, '') - if writer.kind_of? Output - writer << " #{content writer.encoding}" - else - writer << " #{content encoding}" - end + writer << " #{content encoding}" writer << STOP.sub(/\\/u, '') end |