summaryrefslogtreecommitdiff
path: root/lib/rexml/xmldecl.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/xmldecl.rb')
-rw-r--r--lib/rexml/xmldecl.rb13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/rexml/xmldecl.rb b/lib/rexml/xmldecl.rb
index 81d3057732..361e4b7106 100644
--- a/lib/rexml/xmldecl.rb
+++ b/lib/rexml/xmldecl.rb
@@ -109,20 +109,9 @@ module REXML
end
private
- def normalized_encoding_name(_encoding)
- if _encoding == ::Encoding::UTF_16BE
- "UTF-16"
- else
- return _encoding.name
- end
- end
-
def content(enc)
rv = "version='#@version'"
- if @writeencoding || enc.to_s !~ /\Autf-8\z/i
- encoding_name = normalized_encoding_name(enc)
- rv << " encoding='#{encoding_name}'"
- end
+ rv << " encoding='#{enc}'" if @writeencoding || enc !~ /utf-8/i
rv << " standalone='#@standalone'" if @standalone
rv
end