scm: add "scm_iconv" method for repository path encoding in abstract_adapter.rb (#2664, #2274).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4906 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-02-21 12:10:16 +00:00
parent ca3b503478
commit 8963579be3
1 changed files with 12 additions and 1 deletions

View File

@ -221,8 +221,19 @@ module Redmine
def strip_credential(cmd)
self.class.strip_credential(cmd)
end
def scm_iconv(to, from, str)
return nil if str.nil?
return str if to == from
begin
Iconv.conv(to, from, str)
rescue Iconv::Failure => err
logger.error("failed to convert from #{from} to #{to}. #{err}")
nil
end
end
end
class Entries < Array
def sort_by_name
sort {|x,y|