lib/unibits/symbolify.rb in unibits-1.2.0 vs lib/unibits/symbolify.rb in unibits-1.2.1
- old
+ new
@@ -78,9 +78,11 @@
COULD_BE_WHITESPACE = '[\p{Space}⠀]'.freeze
def self.symbolify(char, encoding = char.encoding)
return "n/a" if Unicode::Categories.category(char) == "Cn"
+ char = char.dup
+
char.tr!(
ASCII_CONTROL_CODEPOINTS.encode(encoding),
ASCII_CONTROL_SYMBOLS.encode(encoding)
)
char.gsub!(