scm: for log in Ruby 1.9, replace invalid UTF-8 to '?' instead of removing.

Refer r3466 #4773.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4926 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2011-02-22 13:39:37 +00:00
parent 9f50e63583
commit 87a6d79b5b
2 changed files with 21 additions and 8 deletions

View File

@@ -216,8 +216,13 @@ class ChangesetTest < ActiveSupport::TestCase
def test_invalid_utf8_sequences_in_comments_should_be_stripped
with_settings :commit_logs_encoding => 'UTF-8' do
c = Changeset.new
c.comments = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
assert_equal "Texte encod en ISO-8859-1.", c.comments
str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
c.comments = str
if str.respond_to?(:force_encoding)
assert_equal "Texte encod? en ISO-8859-1.", c.comments
else
assert_equal "Texte encod en ISO-8859-1.", c.comments
end
end
end