luit

From Wikipedia, the free encyclopedia
Jump to: navigation, search
luit
luit rendering ISO 8859-1 accented characters on a UTF-8 terminal emulator.
luit rendering ISO 8859-1 accented characters on a UTF-8 terminal emulator.
Original author(s) Juliusz Chroboczek
Initial release 2001; 13 years ago (2001)
Stable release 1.1.1 / March 22, 2012 (2012-03-22)[1]
Operating system Unix-like systems
Type Utility software
License MIT/X Consortium License
Website http://invisible-island.net/luit/

In computing, luit is a tool used to translate the character set of a program so that its output can be displayed correctly on a terminal emulator that uses a different character set.[2] Whereas iconv converts the character set of strings or text files at rest, luit converts the input and output of programs running interactively.

luit was written in 2001 by Juliusz Chroboczek,[3] when major Linux distributions began migrating to the Unicode character set from "legacy" encodings such as ISO 8859-1.[4] It has since become a widely-installed base utility, present on more than half of all Linux computer systems by some estimates.[5][6] It is also part of IBM's AIX.[7]

There are two versions of luit: one maintained by Thomas Dickey[8] as part of xterm, and another by Freedesktop.org.[9] Linux distributions generally ship the latter version[10] as part of their X11 utilities package.

The main purpose of luit is to allow "legacy" applications that use character sets other than UTF-8 to work with contemporary terminal emulators.

luit may be required today when connecting to a "legacy" host that only supports an older encoding, such as ISO 8859-1. For example, instead of running "ssh legacy-machine", a user may have to run "LC_ALL=fr_FR luit ssh legacy-machine" to properly render French accented characters on a UTF-8 terminal.[2]

luit is also used to properly render the output of applications that use ISO 2022 character set switching. ISO 2022 is an older standard[4] that allowed an application to "switch" between different fonts, e.g., to mix line-drawing characters with text or to display text in multiple languages and character sets. UTF-8 itself does not support switching fonts; the encoding is stateless and gives each unique character (including line-drawing characters) its own numerical encoding. It can be used to translate between these two encodings.

Examples of programs that require translation to run correctly on a UTF-8 terminal include earlier versions of emacs/MULE,[3] and programs that use ISO 2022 shift sequences in ANSI escape codes that switch to an alternate character set in order to draw line-drawing characters.

luit is invoked automatically by xterm when necessary to translate program output into UTF-8,[8] for programs running on a local computer. When connecting remotely to another computer, the user must run luit directly.

luit interprets application output according to the locale's character set with ISO 2022 shifts and ECMA-48 escape sequences. If an application is speaking a different language than the locale's character set (one that may have matched the terminal emulator's expectations in the absence of luit), luit can misinterpret the application's output and produce corrupted output to the terminal.[11]

See also[edit]

References[edit]