LUIT(1)

๐Ÿ“ฆ
version 2.0.20250912 ยท 5 versions
, in debian trixie, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

๐ŸŽ€ 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 in argv[0] ๐Ÿซถ
  • -c โ€” works as a simple converter from standard input to standard output ๐Ÿ”
  • -encoding encoding โ€” tells luit to use encoding instead 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 of g0, g1, g2 or g3. the default depends on the locale, but is usually g0 ๐ŸŽฏ
  • -gr gk โ€” sets the initial assignment of GR in the output. the default depends on the locale and is usually g2, except for EUC locales, where it's g1 ๐Ÿ’ซ
  • -h โ€” shows a usage and options message on standard output, then quits ๐Ÿ“œ
  • -ilog filename โ€” logs every byte received from the child into filename ๐Ÿ“
  • -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 of g0, g1, g2 or g3. the default depends on the locale, but is usually g0 ๐ŸŽฏ
  • -kgr gk โ€” sets the initial assignment of GR in the input. the default depends on the locale and is usually g2, except for EUC locales, where it's g1 ๐Ÿ’ซ
  • -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 into filename ๐Ÿ“ค
  • +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 -t option 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 -vv does 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 ๐ŸŒธ

these ones are Linux-specific ๐Ÿ“

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