test-bot: fix encoding caused by UTF-8 regex
This commit is contained in:
parent
a6b918d6c5
commit
60055ba890
@ -919,7 +919,9 @@ module Homebrew
|
||||
if step.has_output?
|
||||
# Remove invalid XML characters
|
||||
# http://www.w3.org/TR/xml/#charsets
|
||||
output = step.output.gsub(/[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]/, "")
|
||||
output = step.output
|
||||
output.force_encoding("UTF-8") if output.respond_to?(:force_encoding)
|
||||
output.gsub!(/[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]/, "")
|
||||
|
||||
if output.bytesize > BYTES_IN_1_MEGABYTE
|
||||
output = "truncated output to 1MB:\n" \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user