Skip to content
Snippets Groups Projects
Commit a1cd582c authored by Saito's avatar Saito Committed by Jeremy Mack
Browse files

fix can not guess problem

parent 2201ef80
No related branches found
No related tags found
No related merge requests found
require 'digest/md5'
module ApplicationHelper
include Utils::CharEncode
 
def gravatar_icon(user_email)
gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com"
Loading
Loading
module CommitsHelper
include Utils::CharEncode
def old_line_number(line, i)
 
end
Loading
Loading
Loading
Loading
@@ -18,13 +18,14 @@ module Utils
 
module CharEncode
def encode(string)
return '' unless string
cd = CharDet.detect(string)
if cd.confidence > 0.6
string.force_encoding(cd.encoding)
end
string.encode("utf-8", :undef => :replace, :replace => "?", :invalid => :replace)
rescue
"Invalid code encoding"
"Invalid Encoding"
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment