Permalink
Browse files

Another Ruby 1.9 encoding fix

  • Loading branch information...
1 parent fd3ac80 commit 6a0c9cf18c1ddc5307789eece9de294c394dc439 Dimitrij Denissenko committed Aug 2, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 app/helpers/browse_helper.rb
@@ -25,6 +25,8 @@ def format_properties(property_hash)
def format_code_with_line_numbers(node)
content = syntax_highlight(node)
+ content.force_encoding('utf-8') if RUBY_VERSION.to_f >= 1.9
+
lines, code = [], []
num = 0
@@ -82,7 +84,7 @@ def link_to_code_line(line_number)
end
def syntax_highlight(node)
- syntax = CodeRay::FileType.fetch node.path, :plaintext, false
+ syntax = CodeRay::FileType.fetch node.path, :plaintext, false
CodeRay.scan(node.content, syntax).html
end

0 comments on commit 6a0c9cf

Please sign in to comment.