diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 8aa96ed4..9ab8d2c5 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -263,7 +263,7 @@ module Linguist # # Returns Integer def sloc - lines.grep(Regexp.new('\S'.encode(encoding))).size + lines.grep(Regexp.new('\S'.encode(encoding || 'ASCII-8BIT'))).size end # Public: Is the blob a generated file?