Skip to content

Instantly share code, notes, and snippets.

@jettero
Last active August 29, 2015 13:59
Show Gist options
  • Select an option

  • Save jettero/10580331 to your computer and use it in GitHub Desktop.

Select an option

Save jettero/10580331 to your computer and use it in GitHub Desktop.
s/\x00/␀/g; # seems like 00 => 2400
s/\x07/␇/g; # and 07 => 2407 … implies that there's
# an easy transform that would literally do
# \x00 — \0x20 → \u2400 — \u2420 automatically.
# damned if I know it though.
__END__
#perl corgifex suggests something like: "\0\1\2"; s/([\x00-\x1f])/"\x{2400}" | $1/eg
that has problems though .. like DEL=127; so he also suggests:
tr(\x00-\x1f)(\x{2400}-\x{241f});
… which is about as short-and-readable as I think it can get.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment