diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index 21cd4f17..068fab7c 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -370,7 +370,7 @@ class Formatter escaped = text.chars.map do |c| output = begin - if c.ord.to_s(16).length > 2 && UNICODE_ESCAPE_BLACKLIST_RE.match(c).nil? + if c.ord > 255 && !UNICODE_ESCAPE_BLACKLIST_RE.match?(c) CGI.escape(c) else c