aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/rexml/xmldecl.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 68343d3c70..1db6c476d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Nov 3 14:43:42 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/xmldecl.rb (REXML::XMLDecl#content): Add missing \A
+ and \z.
+
Sat Nov 3 14:42:55 2012 Kouhei Sutou <kou@cozmixng.org>
* lib/rexml/output.rb (REXML::Output#initialize): Use normalized
diff --git a/lib/rexml/xmldecl.rb b/lib/rexml/xmldecl.rb
index eac4b17971..465e6abeb7 100644
--- a/lib/rexml/xmldecl.rb
+++ b/lib/rexml/xmldecl.rb
@@ -107,7 +107,7 @@ module REXML
private
def content(enc)
rv = "version='#@version'"
- rv << " encoding='#{enc}'" if @writeencoding || enc !~ /utf-8/i
+ rv << " encoding='#{enc}'" if @writeencoding || enc !~ /\Autf-8\z/i
rv << " standalone='#@standalone'" if @standalone
rv
end