refactor each_line detect to detect all diff file

This commit is contained in:
Saito 2011-12-01 15:59:49 +08:00
parent c2cfc52e44
commit 42ba6d04f8
2 changed files with 5 additions and 3 deletions

View file

@ -23,6 +23,8 @@ module Utils
string.force_encoding(cd.encoding)
end
string.encode("utf-8", :undef => :replace, :replace => "?", :invalid => :replace)
rescue
"Invalid code encoding"
end
end