Commit f33cf247b6387a5a0f33a4ccb4867ab2d2f14d4e

Authored by Dmitriy Zaporozhets
2 parents 5d240827 8c7c43b9

Merge pull request #833 from Nek-/patch-utf8

Added force utf8 encoding
app/views/refs/_tree.html.haml
... ... @@ -42,9 +42,9 @@
42 42 .readme
43 43 - if content.name =~ /\.(md|markdown)$/i
44 44 = preserve do
45   - = markdown(content.data)
  45 + = markdown(content.data.force_encoding('UTF-8'))
46 46 - else
47   - = simple_format(content.data)
  47 + = simple_format(content.data.force_encoding('UTF-8'))
48 48  
49 49 - if params[:path]
50 50 - history_path = tree_file_project_ref_path(@project, @ref, params[:path])
... ...
app/views/refs/_tree_file.html.haml
... ... @@ -13,7 +13,7 @@
13 13 #tree-readme-holder
14 14 .readme
15 15 = preserve do
16   - = markdown(file.data)
  16 + = markdown(file.data.force_encoding('UTF-8'))
17 17 - else
18 18 .view_file_content
19 19 - unless file.empty?
... ... @@ -28,9 +28,9 @@
28 28 %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
29 29 - else
30 30 %center
31   - = link_to blob_project_ref_path(@project, @ref, :path => params[:path]) do
  31 + = link_to blob_project_ref_path(@project, @ref, :path => params[:path]) do
32 32 %div
33 33 %br
34 34 = image_tag "download.png", :width => 64
35   - %h3
  35 + %h3
36 36 Download (#{file.mb_size})
... ...