##// END OF EJS Templates
scm: bazaar: convert path encoding from @path_encoding to UTF-8 at adapter entries method (#11834)...
Toshi MARUYAMA -
r10235:a701bd5fbd34
parent child
Show More
@@ -91,13 +91,17 module Redmine
91 cmd_args << "-r#{identifier.to_i}"
91 cmd_args << "-r#{identifier.to_i}"
92 cmd_args << bzr_target(path)
92 cmd_args << bzr_target(path)
93 scm_cmd(*cmd_args) do |io|
93 scm_cmd(*cmd_args) do |io|
94 prefix = "#{url}/#{path}".gsub('\\', '/')
94 prefix_utf8 = "#{url}/#{path}".gsub('\\', '/')
95 logger.debug "PREFIX: #{prefix}"
95 logger.debug "PREFIX: #{prefix_utf8}"
96 prefix = scm_iconv(@path_encoding, 'UTF-8', prefix_utf8)
97 prefix.force_encoding('ASCII-8BIT') if prefix.respond_to?(:force_encoding)
96 re = %r{^V\s+(#{Regexp.escape(prefix)})?(\/?)([^\/]+)(\/?)\s+(\S+)\r?$}
98 re = %r{^V\s+(#{Regexp.escape(prefix)})?(\/?)([^\/]+)(\/?)\s+(\S+)\r?$}
97 io.each_line do |line|
99 io.each_line do |line|
98 next unless line =~ re
100 next unless line =~ re
99 entries << Entry.new({:name => $3.strip,
101 name_locale = $3.strip
100 :path => ((path.empty? ? "" : "#{path}/") + $3.strip),
102 name = scm_iconv('UTF-8', @path_encoding, name_locale)
103 entries << Entry.new({:name => name,
104 :path => ((path.empty? ? "" : "#{path}/") + name),
101 :kind => ($4.blank? ? 'file' : 'dir'),
105 :kind => ($4.blank? ? 'file' : 'dir'),
102 :size => nil,
106 :size => nil,
103 :lastrev => Revision.new(:revision => $5.strip)
107 :lastrev => Revision.new(:revision => $5.strip)
General Comments 0
You need to be logged in to leave comments. Login now