summaryrefslogtreecommitdiff
path: root/lib/rexml/document.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-30 12:10:56 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-30 12:10:56 +0000
commit994f066f76857a781f8819b8da2c2aeceedbf87b (patch)
treed89e9bcf6ac8d558367f888919de0c4894224063 /lib/rexml/document.rb
parent767fe5170d97461be5c79936b467dee3d4eb7179 (diff)
* lib/rexml/encoding.rb: use Ruby native encoding mechnism. [ruby-dev:42464]
* lib/rexml/encodings/: remove. * lib/rexml/document.rb, lib/rexml/formatters/default.rb, lib/rexml/output.rb, lib/rexml/parseexception.rb, lib/rexml/parsers/baseparser.rb, lib/rexml/source.rb, lib/rexml/xmldecl.rb: use Ruby's native Encoding object. * test/rexml/, test/rss/: follow the above encoding chagnes. * NEWS: add REXML's incompatible change about encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/document.rb')
-rw-r--r--lib/rexml/document.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb
index 0337553a2e..68a744d9e5 100644
--- a/lib/rexml/document.rb
+++ b/lib/rexml/document.rb
@@ -131,7 +131,8 @@ module REXML
xml_decl().version
end
- # @return the XMLDecl encoding of this document as a String.
+ # @return the XMLDecl encoding of this document as an
+ # Encoding object.
# If no XMLDecl has been set, returns the default encoding.
def encoding
xml_decl().encoding
@@ -183,7 +184,7 @@ module REXML
# that IE's limited abilities can handle. This hack inserts a space
# before the /> on empty tags. Defaults to false
def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
- if xml_decl.encoding != "UTF-8" && !output.kind_of?(Output)
+ if xml_decl.encoding != ::Encoding::UTF_8 && !output.kind_of?(Output)
output = Output.new( output, xml_decl.encoding )
end
formatter = if indent > -1