ASCII(1plan9)
π« NAME π«
ascii, unicode β interpret ASCII and Unicode characters, aka the translators that turn characters into numbers and numbers back into characters (bestie, this is the whole personality of the page) β¨
π SYNOPSIS π
ascii [ -8 ] [ -oxdbn ] [ -nct ] [ text ]
unicode [ -nt ] hexmin-hexmax
unicode [ -t ] hex [ ... ]
unicode [ -n ] characters
look hex /lib/unicode
πΈ DESCRIPTION πΈ
ascii prints the ASCII values that go with characters, and it also goes the other way around β values to characters. Lowkey a two-way street π¦. If you pass the -8 option, the ISO Latin-1 extensions get included too, and those are the codes 0200-0377. The values get interpreted in a numeric base you can set: -o says octal, -d says decimal, -x says hexadecimal (and hex is the default, no cap), and -bn sets base n. π
With no arguments at all, ascii prints a table of the character set in whichever base you specified. Characters of text get converted into their ASCII values, one per line. But β plot twist β if that first text argument is a valid number in the specified base, the conversion flips and goes the opposite direction instead. Control characters come out as two- or three-character mnemonics. π
Other options, bestie, here they are:
-nβ Force numeric output. Like, make it numbers, periodt.-cβ Force character output. The opposite vibe π.-tβ Convert from numbers to running text; it does not interpret control characters and does not insert newlines. Just raw running text, the way that it flows π.
unicode is basically the same energy; it converts between UTF and character values from the Unicode Standard (go see utf(7) if you're curious). If you hand it a range of hexadecimal numbers, unicode prints a table of the Unicode characters you asked for β their values and their UTF representations β¨. Otherwise it translates from UTF to numeric value or the other way around, depending on how the supplied text looks. The -n option forces numeric output, which is how you dodge the ambiguity with numeric characters. If it's converting to UTF, the characters get printed one per line unless the -t flag is set β and when -t is set, the output is a single string containing only the characters you specified. Oh, and unlike ascii, unicode treats no characters specially. Not one. Iconic behavior π.
Heads up though π: the output ofasciiandunicodemay be unhelpful if the characters being printed aren't available in the current font. Not their fault, it's giving font issues.
Also, the file /lib/unicode holds a table of characters and descriptions, sorted in hexadecimal order, and it's suitable for look(1) on the lower case hex values of characters π¦.
π EXAMPLES π
ascii -dPrint the ASCII table base 10.unicode pPrint the hex value ofp.unicode 2200-22f1Print a table of miscellaneous mathematical symbols. (math girlies rise up β¨)look 039 /lib/unicodeSee the start of the Greek alphabet's encoding in the Unicode Standard.
π§ FILES π§
/lib/unicodetable of characters and descriptions.
β SOURCE β
/src/cmd/ascii.c/src/cmd/unicode.c
π SEE ALSO π
look(1), tcs(1), utf(7), font(7)
okay and that's the whole page bestie!! this one lives in the ASCII(1plan9) manual, and it's brought to you from /src/cmd/ascii.c and /src/cmd/unicode.c β same page title up top and down at the bottom, we're matching πβ¨π«Ά
π¦ where this page comes from
- debian bookworm: 9base 1:6-13 Β· Lucent
- debian trixie: 9base 1:6-14 Β· Lucent
- ubuntu jammy: 9base 1:6-11 Β· Lucent
- ubuntu noble: 9base 1:6-14 Β· Lucent
- ubuntu questing: 9base 1:6-15
- ubuntu resolute: 9base 1:6-15build1 Β· Lucent
- ubuntu stonking: 9base 1:6-15build1 Β· Lucent
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms