From 42ba6d04f84b722bc1212378633cd8c05a2c6ded Mon Sep 17 00:00:00 2001 From: Saito Date: Thu, 1 Dec 2011 15:59:49 +0800 Subject: refactor each_line detect to detect all diff file --- lib/utils.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/utils.rb') diff --git a/lib/utils.rb b/lib/utils.rb index d0339c2b271..411abef2f69 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -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 -- cgit v1.2.1