From da2c511cd1eadcb7adef1aa2c078ca707410f70d Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 15 Apr 2011 07:17:26 +0000 Subject: [PATCH] scm: cvs: convert encoding paths in entries() of adapter (#3462). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5464 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/cvs_adapter.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb index 32de489e..f010260e 100644 --- a/lib/redmine/scm/adapters/cvs_adapter.rb +++ b/lib/redmine/scm/adapters/cvs_adapter.rb @@ -92,6 +92,8 @@ module Redmine # this method is used by the repository-browser (aka LIST) def entries(path=nil, identifier=nil) logger.debug " entries '#{path}' with identifier '#{identifier}'" + path_locale = scm_iconv(@path_encoding, 'UTF-8', path) + path_locale.force_encoding("ASCII-8BIT") if path_locale.respond_to?(:force_encoding) entries = Entries.new cmd_args = %w|-q rls -e| cmd_args << "-D" << time_to_cvstime_rlog(identifier) if identifier @@ -113,15 +115,15 @@ module Redmine end entries << Entry.new( { - :name => fields[-5], + :name => scm_iconv('UTF-8', @path_encoding, fields[-5]), #:path => fields[-4].include?(path)?fields[-4]:(path + "/"+ fields[-4]), - :path => "#{path}/#{fields[-5]}", + :path => scm_iconv('UTF-8', @path_encoding, "#{path_locale}/#{fields[-5]}"), :kind => 'file', :size => nil, :lastrev => Revision.new( { :revision => fields[-4], - :name => fields[-4], + :name => scm_iconv('UTF-8', @path_encoding, fields[-4]), :time => time, :author => '' }) @@ -129,8 +131,8 @@ module Redmine else entries << Entry.new( { - :name => fields[1], - :path => "#{path}/#{fields[1]}", + :name => scm_iconv('UTF-8', @path_encoding, fields[1]), + :path => scm_iconv('UTF-8', @path_encoding, "#{path_locale}/#{fields[1]}"), :kind => 'dir', :size => nil, :lastrev => nil -- 2.11.0