##// END OF EJS Templates
scm: additional test of replacing invalid utf-8 sequences instead of stripping in displaying repository contents on Ruby 1.8....
Toshi MARUYAMA -
r5308:5bb06ae42d53
parent child
Show More
@@ -100,4 +100,17 class RepositoryHelperTest < HelperTestCase
100 assert_equal "Texte encod? en ISO-8859-1.", str
100 assert_equal "Texte encod? en ISO-8859-1.", str
101 end
101 end
102 end
102 end
103
104 def test_to_utf8_invalid_utf8_sequences_should_be_stripped_ja_jis
105 with_settings :repositories_encodings => 'ISO-2022-JP' do
106 s1 = "test\xb5\xfetest\xb5\xfe"
107 s1.force_encoding("ASCII-8BIT") if s1.respond_to?(:force_encoding)
108 str = to_utf8(s1)
109 if str.respond_to?(:force_encoding)
110 assert str.valid_encoding?
111 assert_equal "UTF-8", str.encoding.to_s
112 end
113 assert_equal "test??test??", str
114 end
115 end
103 end
116 end
General Comments 0
You need to be logged in to leave comments. Login now