From 06f078a8137a532e638274abc89d5a06654865e1 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 28 Feb 2011 12:09:32 +0000 Subject: scm: ignore log encoding setting in Subversion and Mercurial (#7597). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4962 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/repository_subversion_test.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/unit/repository_subversion_test.rb') diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb index 5e0b07183..158f17c55 100644 --- a/test/unit/repository_subversion_test.rb +++ b/test/unit/repository_subversion_test.rb @@ -137,6 +137,28 @@ class RepositorySubversionTest < ActiveSupport::TestCase assert c.event_title.include?('123456789:') assert_equal '123456789', c.event_url[:rev] end + + def test_log_encoding_ignore_setting + with_settings :commit_logs_encoding => 'windows-1252' do + s1 = "\xC2\x80" + s2 = "\xc3\x82\xc2\x80" + if s1.respond_to?(:force_encoding) + s3 = s1 + s4 = s2 + s1.force_encoding('ASCII-8BIT') + s2.force_encoding('ASCII-8BIT') + s3.force_encoding('ISO-8859-1') + s4.force_encoding('UTF-8') + assert_equal s3.encode('UTF-8'), s4 + end + c = Changeset.new(:repository => @repository, + :comments=>s2, + :revision=>'123', + :committed_on => Time.now) + assert c.save + assert_equal s2, c.comments + end + end else puts "Subversion test repository NOT FOUND. Skipping unit tests !!!" def test_fake; assert true end -- cgit v1.2.3