Is there any way to tell if a given character (e.g. ä
) or a code point (e.g. 228) represents a printable character (and not, say, a formatting control or something non-printable)?
Any of these works:
String.printable?(<<228>>)
String.printable?(<<0x00E4 :: utf8>>)
String.printable?("ä")
String.printable?("\u00ff")
7 Likes