uni2ascii(1)
π uni2ascii π
β¨ NAME β¨
uni2ascii β the girl who takes your UTF-8 Unicode and converts it into a whole menu of 7-bit ASCII representations. no cap, she's fluent in like thirty flavors of escape sequence π
π¦ SYNOPSIS π¦
uni2ascii [options] (<input file name>)
π DESCRIPTION π
okay so listen bestie, uni2ascii converts UTF-8 Unicode to various 7-bit ASCII representations. if you don't specify a format, she just defaults to standard hexadecimal format (e.g. 0x00e9) because that's her comfort zone. she reads from the standard input and writes to the standard output, like a well-behaved icon. periodt.
Command line options are:
π OPTIONS π
-Aβ List the single character approximations carried out by the-yflag. she'll show you the whole receipts, no secrets π§Ύ-a<format>β Convert to the specified format. and here's the tea: you can name a format by these arbitrary single character codes, by names like"SGML_decimal", or literally just by showing her an example of the format you want. she'll figure it out. main character energy fr fr π«Aβ Generate hexadecimal numbers with prefixUin angle-brackets (e.g.<U00E9>).Bβ Generate\x-escaped hex (e.g.\x00E9)Cβ Generate\xescaped hexadecimal numbers in braces (e.g.\x{00E9}).Dβ Generate decimal HTML numeric character references (e.g.é)Eβ Generate hexadecimal with prefixU(U00E9).Fβ Generate hexadecimal with prefixu(u00E9).Gβ Convert hexadecimal in single quotes with prefixX(e.g.X'00E9').Hβ Generate hexadecimal HTML numeric character references (e.g.é)Iβ Generate hexadecimal UTF-8 with each byte's hex preceded by an=-sign (e.g.=C3=A9) . This is the Quoted Printable format defined by RFC 2045.Jβ Generate hexadecimal UTF-8 with each byte's hex preceded by a%-sign (e.g.%C3%A9). This is the URI escape format defined by RFC 2396.Kβ Generate octal UTF-8 with each byte escaped by a backslash (e.g.\303\251)Lβ Generate\U-escaped hex outside the BMP,\u-escaped hex within the BMP (U+0000-U+FFFF).Mβ Generate hexadecimal SGML numeric character references (e.g.\#xE9;)Nβ Generate decimal SGML numeric character references (e.g.\#233;)Oβ Generate octal escapes for the three low bytes in big-endian order (e.g.\000\000\351))Pβ Generate hexadecimal numbers with prefixU+(e.g.U+00E9)Qβ Generate character entities (e.g.é) where possible, otherwise hexadecimal numeric character references.Rβ Generate raw hexadecimal numbers (e.g.00E9)Sβ Generate hexadecimal escapes for the three low bytes in big-endian order (e.g.\x00\x00\xE9)Tβ Generate decimal escapes for the three low bytes in big-endian order (e.g.\d000\d000\d233)Uβ Generate\u-escaped hexadecimal numbers (e.g.\u00E9).Vβ Generate\u-escaped decimal numbers (e.g.\u00233).Xβ Generate standard hexadecimal numbers (e.g.0x00E9).0β Generate hexadecimal UTF-8 with each byte's hex enclosed within angle brackets (e.g.<C3><A9>).1β Generate Common Lisp format hexadecimal numbers (e.g.#x00E9).2β Generate Perl format decimal numbers with prefixv(e.g.v233).3β Generate hexadecimal numbers with prefix$(e.g.$00E9).4β Generate Postscript format hexadecimal numbers with prefix16#(e.g.16#00E9).5β Generate Common Lisp format hexadecimal numbers with prefix#16r(e.g.#16r00E9).6β Generate ADA format hexadecimal numbers with prefix16#and suffix#(e.g.16#00E9#).7β Generate Apache log format hexadecimal UTF-8 with each byte's hex preceded by a backslash-x (e.g.\xC3\xA9).8β Generate Microsoft OOXML format hexadecimal numbers with prefix_xand suffix_(e.g._x00E9_).9β Generate%\u-escaped hexadecimal numbers (e.g.%\u00E9).
-Bβ Transform to ASCII if possible. This option is equivalent to the combinationcdefx. it's the "just make it work" button, lowkey iconic π«Ά-cβ Convert circled and parenthesized characters to their unenclosed counterparts. freedom!! let them OUT of the circle ββ‘οΈβ¨-dβ Strip diacritics. This converts single codepoints representing characters with diacritics to the corresponding ASCII character and deletes separately encoded diacritics. bye bye little accent marks, you served π¨-eβ Convert characters to their approximate ASCII equivalents, as follows:U+0085next line β0x0AnewlineU+00A0no break space β0x20spaceU+00ABleft-pointing double angle quotation mark β0x22double quoteU+00ADsoft hyphen β0x2DminusU+00AFmacron β0x2DminusU+00B7middle dot β0x2EperiodU+00BBright-pointing double angle quotation mark β0x22double quoteU+1361ethiopic word space β0x20spaceU+1680ogham space β0x20spaceU+2000en quad β0x20spaceU+2001em quad β0x20spaceU+2002en space β0x20spaceU+2003em space β0x20spaceU+2004three-per-em space β0x20spaceU+2005four-per-em space β0x20spaceU+2006six-per-em space β0x20spaceU+2007figure space β0x20spaceU+2008punctuation space β0x20spaceU+2009thin space β0x20spaceU+200Ahair space β0x20spaceU+200Bzero-width space β0x20spaceU+2010hyphen β0x2DminusU+2011non-breaking hyphen β0x2DminusU+2012figure dash β0x2DminusU+2013en dash β0x2DminusU+2014em dash β0x2DminusU+2018left single quotation mark β0x60left single quoteU+2019right single quotation mark β0x27right or neutral single quoteU+201Asingle low-9 quotation mark β0x60left single quoteU+201Bsingle high-reversed-9 quotation mark β0x60left single quoteU+201Cleft double quotation mark β0x22double quoteU+201Dright double quotation mark β0x22double quoteU+201Edouble low-9 quotation mark β0x22double quoteU+201Fdouble high-reversed-9 quotation mark β0x22double quoteU+2022bullet β0x6Fsmall letter oU+2028line separator β0x0AnewlineU+2032prime β0x27right or neutral single quoteU+2033double prime β0x22double quoteU+2039single left-pointing angle quotation mark β0x60left single quoteU+203Asingle right-pointing angle quotation mark β0x27right or neutral single quoteU+204Elow asterisk β0x2AasteriskU+2212minus sign β0x2DminusU+2216set minus β0x5CbackslashU+2217asterisk operator β0x2AasteriskU+2223divides β0x7Cvertical lineU+2500box drawing light horizontal β0x2DminusU+2501box drawing heavy horizontal β0x2DminusU+2502box drawing light vertical β0x7Cvertical lineU+2503box drawing heavy vertical β0x7Cvertical lineU+2731heavy asterisk β0x2AasteriskU+275Dheavy double turned comma quotation mark β0x22double quoteU+275Eheavy double comma quotation mark β0x22double quoteU+3000ideographic space β0x20spaceU+FE60small ampersand β0x26ampersandU+FE61small asterisk β0x2AasteriskU+FE62small plus sign β0x2Bplus sign
-Eβ List the expansions performed by the-xflag. spill the tea on what-xdoes, she's not gatekeeping π΅-fβ Convert stylistic variants to plain ASCII. Stylistic equivalents include: superscript and subscript forms, small capitals (e.g.U+1D04), script forms (e.g.U+212C), black letter forms (e.g.U+212D), fullwidth forms (e.g.U+FF01), halfwidth forms (e.g.U+FF7B), and the mathematical alphanumeric symbols (e.g.U+1D400). basically every fancy font your notes app offers? she's flattening all of them. sorry to the aesthetic π-hβ Help. Print the usage message and exit. when in doubt, ask her π¬-lβ Use lowercasea-fwhen generating hexadecimal numbers. lowercase is a vibe, honestly π-nβ Convert newlines too. By default, they are left alone. she respects the line break's boundaries unless you say otherwise π§-Pβ Pass through Unicode rather than converting to ASCII escapes if the character is not converted to an ASCII character by a transformation such as diacritic stripping. Note that if this option is used the output may not be pure ASCII.
β οΈ heads up bestie β flip this on and your output might not be pure ASCII anymore. she's telling you upfront so you can't be mad later π
-pβ Pure. Convert characters within the ASCII range except for space and newline as well as those above. no survivors, everything gets processed π-qβ Quiet. Do not chat unnecessarily while working. she's locking in π-sβ Convert space characters too. By default, they are left alone. spaces get the same treatment as the newlines up there, iykyk β¨-S<Unicode:ASCII>β Define a custom substitution. The argument should consist of the Unicode codepoint to be replaced followed by the ASCII code of the character to be used as replacement, separated by a colon. If no ASCII code follows the colon, the specified Unicode character will be deleted. The code values may be in hexadecimal, octal, or decimal following the usual conventions (to be precise, those ofstrtoul(3)). This option may be repeated as many times as desired to define multiple substitutions. build your own ruleset, custom queen behavior π-vβ Print program version information and exit. know your version, always π-wβ Add a space after each converted item. personal space bubble for every single escape sequence πΈ-xβ okay so bestie, this one expands certain characters to multicharacter sequences. The characters affected are the same as those affected by the-yoption. Here's the whole list, no cap:
U+00A2 CENT SIGN -> cent
U+00A3 POUND SIGN -> pound
U+00A5 YEN SIGN -> yen
U+00A9 COPYRIGHT SYMBOL -> (c)
U+00AE REGISTERED SYMBOL -> (R)
U+00BC ONE QUARTER -> 1/4
U+00BD ONE HALF -> 1/2
U+00BE THREE QUARTERS -> 3/4
U+00C6 CAPITAL LETTER ASH -> AE
U+00DF SMALL LETTER SHARP S -> ss
U+00E6 SMALL LETTER ASH -> ae
U+0132 LIGATURE IJ -> IJ
U+0133 LIGATURE ij -> ij
U+0152 LIGATURE OE -> OE
U+0153 LIGATURE oe -> oe
U+01F1 CAPITAL LETTER DZ -> DZ
U+01F2 MIXED LETTER Dz -> Dz
U+01F3 SMALL LETTER DZ -> dz
U+02A6 SMALL LETTER TS DIGRAPH -> ts
U+2026 HORIZONTAL ELLIPSIS -> ...
U+20AC EURO SIGN -> euro
U+2122 TRADEMARK SIGN -> (tm) br U+22EF MIDLINE
HORIZONTAL ELLIPSIS -> ...
U+2190 LEFTWARDS ARROW -> <-
U+2192 RIGHTWARDS ARROW -> ->
U+21D0 LEFTWARDS DOUBLE ARROW -> <=
U+21D2 RIGHTWARDS DOUBLE ARROW -> =>
U+FB00 LATIN SMALL LIGATURE FF -> ff
U+FB01 LATIN SMALL LIGATURE FI -> fi
U+FB02 LATIN SMALL LIGATURE FL -> fl
U+FB03 LATIN SMALL LIGATURE FFI -> ffi
U+FB04 LATIN SMALL LIGATURE FFL -> ffl
U+FB06 LATIN SMALL LIGATURE ST -> st
-yβ this one converts certain characters having multi-character expansions to single-character ascii approximations instead (e.g. to maintain character-positioning). The characters affected are the same as those affected by the-xoption. It's giving compact vibes, fr fr:
U+00A2 CENT SIGN -> c
U+00A3 POUND SIGN -> #
U+00A5 YEN SIGN -> Y
U+00A9 COPYRIGHT SYMBOL -> C
U+00AE REGISTERED SYMBOL -> R
U+00BC ONE QUARTER -> -
U+00BD ONE HALF -> -
U+00BE THREE QUARTERS -> -
U+00C6 CAPITAL LETTER ASH -> A
U+00DF SMALL LETTER SHARP S -> s
U+00E6 SMALL LETTER ASH -> a
U+0132 LIGATURE IJ -> I
U+0133 LIGATURE ij -> i
U+0152 LIGATURE OE -> O
U+0153 LIGATURE oe -> o
U+01F1 CAPITAL LETTER DZ -> D
U+01F2 MIXED LETTER Dz -> D
U+01F3 SMALL LETTER DZ -> d
U+02A6 SMALL LETTER TS DIGRAPH -> t
U+2026 HORIZONTAL ELLIPSIS -> .
U+20AC EURO SIGN -> E
U+22EF MIDLINE HORIZONTAL ELLIPSIS -> .
U+2190 LEFTWARDS ARROW -> <
U+2192 RIGHTWARDS ARROW -> >
U+21D0 LEFTWARDS DOUBLE ARROW -> <
U+21D2 RIGHTWARDS DOUBLE ARROW -> >
-Z <format>β generate output using the supplied format. The format specified will be used as the format string in a call toprintf(3)with a single argument consisting of an unsigned long integer. For example, to obtain the same output as with the-Uflag, the format would be:\u%04X.
If conversion of spaces is disabled (as it is by default), if space characters outside the ASCII range are encountered (U+3000 ideographic space, U+1351 Ethiopic word space, and U+1680 ogham space mark), they are replaced with the ASCII space character (0x20) so as to keep the output pure 7-bit ASCII. <sparkle>β¨</sparkle>
Note that XML and XHTML numeric character entities are like those of HTML with two restrictions. First, in X(HT)ML the terminating semi-colon may not be omitted. Second, in X(HT)ML the "x" must be lower-case, while in HTML it may be either upper- or lower-case. We always generate the terminating semi-colon and use a lower-case "x", so the option dubbed "HTML" produces valid XML and XHTML as well. periodt.
π EXIT STATUS π
The following values are returned on exit:
0SUCCESS β the input was successfully converted. π2I/O ERROR β a system error ocurred during input or output. π3INFO β the user requested information such as the version number or usage synopsis and this has been provided. β¨5BAD OPTION β an incorrect option flag was given on the command line. π8BAD RECORD β ill-formed UTF-8 was detected in the input. π
π SEE ALSO π
ascii2uni(1)Text::Unidecode
π«Ά AUTHOR π«Ά
Bill Poser <billposer@alum.mit.edu> β this icon wrote it. π
π LICENSE π
GNU General Public License. That's it. No cap.
This page is from uni2ascii(1), dated August, 2013. Stay slay, bestie. π
β¨
π¦ where this page comes from
- debian trixie: uni2ascii 4.20-1 Β· GPL-3.0-or-later
- nixos 26.05: uni2ascii 4.20
- nixpkgs unstable: uni2ascii 4.20
- ubuntu questing: uni2ascii 4.20-1
- ubuntu resolute: uni2ascii 4.20-1build1 Β· GPL-3.0-or-later
- ubuntu stonking: uni2ascii 4.20-3 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms