LUIT(1)
๐ luit(1) ๐ General Commands Manual
โจ NAME โจ
luit ๐ Locale and ISO 2022 support for Unicode terminals
๐ง SYNOPSIS ๐ง
luit [ options ] [ -- ] [ program [ args ] ]
๐ DESCRIPTION ๐
okay so luit is a filter that you can slot between any app and a UTF-8 terminal emulator ๐ฆ it converts the app's output from the locale's encoding into UTF-8, and it converts the terminal's input from UTF-8 back into the locale's encoding. main character energy, literally โจ
luit reads its input from the child process (aka the app running in your terminal) and writes its output to the terminal. the two directions can have different encodings, so it's totally fine if they don't match ๐
an app can also ask for a switch to a different output encoding using ISO 2022 and ISO 6429 escape sequences. ngl this is discouraged ๐ the better move is for multilingual apps to just generate UTF-8 directly.
luit is usually invoked for you, transparently, by the terminal emulator. if you want to run luit from the command line yourself, check out EXAMPLES below ๐
๐ธ OPTIONS ๐ธ
-Vโ print luit's version and then quit ๐-alias filenameโ the locale alias file (default:unknown) ๐๏ธ-argv0 nameโ sets the child's name, the one passed inargv[0]๐ซถ-cโ works as a simple converter from standard input to standard output ๐-encoding encodingโ tells luit to useencodinginstead of the current locale's encoding ๐-g0 charsetโ sets the output charset that's selected in G0 at startup. the default depends on the locale but is usually ASCII ๐ค-g1 charsetโ sets the output charset that's selected in G1 at startup. the default depends on the locale ๐ค-g2 charsetโ sets the output charset that's selected in G2 at startup. the default depends on the locale ๐ค-g3 charsetโ sets the output charset that's selected in G3 at startup. the default depends on the locale ๐ค-gl gnโ sets the initial assignment of GL in the output. the argument should be one ofg0,g1,g2org3. the default depends on the locale, but is usuallyg0๐ฏ-gr gkโ sets the initial assignment of GR in the output. the default depends on the locale and is usuallyg2, except for EUC locales, where it'sg1๐ซ-hโ shows a usage and options message on standard output, then quits ๐-ilog filenameโ logs every byte received from the child intofilename๐-k7โ generates seven-bit characters for keyboard input ๐น-kg0 charsetโ sets the input charset that's selected in G0 at startup. the default depends on the locale, but is usually ASCII โจ๏ธ-kg1 charsetโ sets the input charset that's selected in G1 at startup. the default depends on the locale โจ๏ธ-kg2 charsetโ sets the input charset that's selected in G2 at startup. the default depends on the locale โจ๏ธ-kg3 charsetโ sets the input charset that's selected in G3 at startup. the default depends on the locale โจ๏ธ-kgl gnโ sets the initial assignment of GL in the input. the argument should be one ofg0,g1,g2org3. the default depends on the locale, but is usuallyg0๐ฏ-kgr gkโ sets the initial assignment of GR in the input. the default depends on the locale and is usuallyg2, except for EUC locales, where it'sg1๐ซ-klsโ generates locking shifts (SO/SI) for keyboard input ๐+kssโ turns off generation of single-shifts for keyboard input ๐+kssgrโ uses GL codes after a single shift for keyboard input. by default, GR codes are generated after a single shift when you're generating eight-bit keyboard input ๐-listโ lists the supported charsets and encodings, then quits. luit uses its internal tables for this, which are based on the fontenc library ๐-list-builtinโ lists the built-in encodings that get used as a fallback when data from iconv or fontenc is missing ๐งฉ
this option only works if luit was configured to use iconv, since the fontenc library doesn't supply a list of built-in encodings.
-list-fontencโ lists the encodings provided by โ.encโ files that were originally distributed with the fontenc library ๐๏ธ-list-iconvโ lists the encodings and locales supported by the iconv library. luit adapts its internal tables of fontenc names to iconv encodings ๐
to make scripting simpler, luit ignores spaces, underscores and ASCII minus-signs (dashes) embedded in the names. it also ignores case when matching charset and encoding names ๐ซง
this option only lists the encodings associated with the locales supported on the current operating system. the portable iconv application gives you a list of its supported encodings with the -l option, and other implementations may offer something similar. there's no portable library call an application can use to get the same info ๐
-olog filenameโ logs every byte sent to the terminal emulator intofilename๐ค+olsโ turns off interpretation of locking shifts in application output ๐+oslโ turns off interpretation of character set selection sequences in application output ๐ซ+ossโ turns off interpretation of single shifts in application output โ+otโ turns off interpretation of all sequences, so every sequence in application output goes to the terminal unchanged. ngl this may lead to interesting results ๐-pโ sets up a handshake between the parent and child processes at startup. this is needed on some older systems, e.g. to successfully copy the terminal settings to the pseudo-terminal ๐ค-prefer listโ sets the lookup-order preference for character set information. the parameter is a comma-separated list of keywords. the default order (listing all keywords) is:
fontenc,builtin,iconv,posix
the default order uses fontenc first, because that lets luit start up more quickly (about 0.1 seconds) than using iconv for complex encodings such as eucJP โก however, you might find the iconv implementation is more accurate or complete. in that case, you can use the -show-iconv option to get a text file that can be used as an encoding with the fontenc configuration ๐ง
this option only works if luit was configured to use iconv, since the fontenc library doesn't offer this choice.
-show-builtin encodingโ shows a built-in encoding, e.g. one from a โ.encโ file, using the โ.encโ format ๐ช
this option only works if luit was configured to use iconv, since the fontenc library doesn't supply a list of built-in encodings.
-show-fontenc encodingโ shows a given encoding, e.g. one from a โ.encโ file, using the โ.encโ format. if luit is configured to use the fontenc library, it gets the info through that library. otherwise, luit reads the file directly ๐
some of fontenc's encodings are built into the library itself, and the fontenc library uses those in preference to an external file. if luit is configured to use iconv, use the -show-builtin option to get similar info ๐
-show-iconv encodingโ shows a given encoding using the โ.encโ format. if luit is configured to use iconv, it gets the info through that interface. if iconv can't supply the info, luit may fall back to a built-in table ๐ช-tโ initializes luit using the locale and command-line options, but doesn't open a pty connection. this is for testing luit's configuration. it exits with success if no errors were detected. repeat the-toption to make warning messages count as errors ๐งช-vโ be verbose! repeating the option, e.g. โ-v -vโ, makes it even more verbose ๐ข luit doesn't use getopt, so-vvdoes not work ๐ โโ๏ธ-xโ exits as soon as the child dies. this may cause luit to lose data at the end of the child's output ๐--โ marks the end of options ๐
โจ EXAMPLES โจ
okay so the most typical way to use luit is to make an instance of XTerm match your locale's encoding ๐ current versions of XTerm call luit automatically when they need it, so you don't have to do anything. but if you're on an older release of XTerm, or a different terminal emulator, you can run it yourself ๐
$ xterm -u8 -e luit
if you're in a UTF-8 locale but need to reach a remote machine that doesn't do UTF-8, luit can translate the remote output so it shows up right on your terminal ๐ฆ
$ LC_ALL=fr_FR luit ssh legacy-machine
luit is also super handy for apps that are hardwired to an encoding that's different from the one your system normally uses, or for apps that want legacy escape sequences for multilingual output ๐ in particular, versions of Emacs that don't speak UTF-8 well can use luit for multilingual output ๐
$ luit -encoding 'ISO 8859-1' emacs -nw
and then, inside Emacs:
M-x set-terminal-coding-system RET iso-2022-8bit-ss2 RET
โจ AUTHORS โจ
luit was written by Juliusz Chroboczek <jch@pps.jussieu.fr> for the XFree86 project ๐ง
Thomas E. Dickey has maintained luit for use by xterm since 2006 ๐ซถ
โจ SEE ALSO โจ
these ones are portable ๐ธ
xterm(1),ncurses(3X).
these ones are Linux-specific ๐
unicode(1),utf-8(1),charsets(1).
these ones are particularly useful, bestie ๐
- Character Code Structure and Extension Techniques (ISO 2022, ECMA-35)
- Control Functions for Coded Character Sets (ISO 6429, ECMA-48)
http://czyborra.com/charsets/
okay that's the whole page, bestie!! ๐ luit lives under the X Window System umbrella and it's the LUIT(1) manual page, so now you're officially encoding-literate ๐ฆโจ go slay the terminal, you've got this ๐ ๐
๐ฆ where this page comes from
- debian trixie: luit 2.0.20240910-1 ยท MIT
- epel 10: luit 2.0.20240910-5.el10_1 ยท MIT
- epel 9: luit 2.0.20240910-5.el9 ยท MIT
- fedora 43: luit 2.0.20240910-6.fc43 ยท MIT
- fedora 44: luit 2.0.20250912-7.fc44 ยท MIT
- nixos 26.05: luit 20250912
- nixpkgs unstable: luit 20250912
- ubuntu questing: luit 2.0.20240910-1 ยท MIT
- ubuntu resolute: luit 2.0.20250912-1 ยท MIT
- ubuntu stonking: luit 2.0.20250912-1 ยท MIT
- Copyright 2006-2021,2024 by Thomas E. Dickey
- Copyright (c) 2001 by Juliusz Chroboczek
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms