lib/travis/tools/safe_string.rb in travis-1.7.2.travis.634.5 vs lib/travis/tools/safe_string.rb in travis-1.7.2.travis.635.5
- old
+ new
@@ -4,9 +4,11 @@
extend self
def encoded(string)
return string unless string.respond_to? :encode
string.encode 'utf-8'
+ rescue Encoding::UndefinedConversionError
+ string.force_encoding 'utf-8'
end
def colorized(string)
encoded(string).gsub(/[^[:print:]\e\n]/, '')
end