Ruby 1.9 revision 14922 is more strict
1 files changed, 10 insertions(+), 5 deletions(-)

M test/contrib_test.rb
M test/contrib_test.rb +10 -5
@@ 225,13 225,18 @@ DELIMITER
   end
 
   def test_umlaut
-		koln_iso = 'Kln'
-		koln_utf = 'Köln'
-                if koln_utf.respond_to? :force_encoding
-                  koln_utf.force_encoding(Encoding::UTF_8)
-                end
+		koln_iso = "K\xf6ln"
+		koln_utf = "K\xc3\xb6ln"
     source_iso = "<?xml version='1.0' encoding='ISO-8859-1'?><test>#{koln_iso}</test>"
     source_utf = "<?xml version='1.0' encoding='UTF-8'?><test>#{koln_utf}</test>"
+
+    if String.method_defined? :encode
+      koln_iso.force_encoding('iso-8859-1')
+      koln_utf.force_encoding('utf-8')
+      source_iso.force_encoding('iso-8859-1')
+      source_utf.force_encoding('utf-8')
+    end
+
 		doc = REXML::Document.new(source_iso)
 		assert_equal('ISO-8859-1', doc.xml_decl.encoding)
 		assert_equal(koln_utf, doc.root.text)