Commit 12c01d74016c266b6acc798c0c1b68765afb4871
1 parent
f114a4f3
Exists in
master
and in
4 other branches
fix encode bugs on diff not utf-8 encode's code
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/views/commits/_text_file.html.haml
lib/utils.rb
... | ... | @@ -29,12 +29,12 @@ module Utils |
29 | 29 | module Colorize |
30 | 30 | include CharEncode |
31 | 31 | def colorize |
32 | - system_colorize(encode(data), name) | |
32 | + system_colorize(data, name) | |
33 | 33 | end |
34 | 34 | |
35 | 35 | def system_colorize(data, file_name) |
36 | 36 | ft = handle_file_type(file_name) |
37 | - Pygments.highlight(data, :lexer => ft, :options => { :encoding => 'utf-8', :linenos => 'True' }) | |
37 | + Pygments.highlight(encode(data), :lexer => ft, :options => { :encoding => 'utf-8', :linenos => 'True' }) | |
38 | 38 | end |
39 | 39 | |
40 | 40 | def handle_file_type(file_name, mime_type = nil) | ... | ... |