##// END OF EJS Templates
scm: add unit test of invalid utf8 sequences should be stripped in repository_helper to_utf8()....
Toshi MARUYAMA -
r5046:09996c35241b
parent child
Show More
@@ -86,4 +86,18 class RepositoryHelperTest < HelperTestCase
86 assert_equal "UTF-8", str2.encoding.to_s
86 assert_equal "UTF-8", str2.encoding.to_s
87 end
87 end
88 end
88 end
89
90 def test_to_utf8_invalid_utf8_sequences_should_be_stripped
91 with_settings :repositories_encodings => '' do
92 s1 = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
93 str = to_utf8(s1)
94 if str.respond_to?(:force_encoding)
95 assert_equal "Texte encod? en ISO-8859-1.", str
96 assert str.valid_encoding?
97 assert_equal "UTF-8", str.encoding.to_s
98 else
99 assert_equal "Texte encod en ISO-8859-1.", str
100 end
101 end
102 end
89 end
103 end
General Comments 0
You need to be logged in to leave comments. Login now