Commit 96d4f22e53a6176715f9557fb0707cb166a1dd80

Authored by Saito
1 parent 1c08cb40

tree view need use ascii-8bit, file name need be utf8.

app/helpers/tree_helper.rb
... ... @@ -18,7 +18,8 @@ module TreeHelper
18 18 end
19 19  
20 20 def tree_full_path(content)
21   - if params[:path]
  21 + content.name.force_encoding('utf-8')
  22 + if params[:path]
22 23 File.join(params[:path], content.name)
23 24 else
24 25 content.name
... ...
app/models/tree.rb
... ... @@ -16,7 +16,7 @@ class Tree
16 16 def initialize(raw_tree, project, ref = nil, path = nil)
17 17 @project, @ref, @path = project, ref, path,
18 18 @tree = if path
19   - raw_tree / path
  19 + raw_tree / path.dup.force_encoding('ascii-8bit')
20 20 else
21 21 raw_tree
22 22 end
... ...
app/views/refs/_tree_file.html.haml
... ... @@ -2,7 +2,7 @@
2 2 .file_title
3 3 %i.icon-file
4 4 %span.file_name
5   - = name
  5 + = name.force_encoding('utf-8')
6 6 %small #{file.mode}
7 7 %span.options
8 8 = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank"
... ...