carta
tran(1)

tran1

Transcribe between character scripts

Usage

tran <input

echo {Hello world | tran script}

Overview

tran lets you convert between Latin and a number of other character scripts. It works as a filter, reading standard input and writing to the standard output.

Please specify the target script as the argument. If none is given, the default is latin. Specify "list" to get the list of supported scripts.

Options

-d, --debug

marks characters that haven't been touched in color. The output must go to a terminal, "less -R" or something that can understand ANSI colors.

Caveats

There is currently no triangulation -- to go between two scripts other than latin you need to convert to latin first.

This especially matters for ascii: to convert, eg, cyrillic text, you need to use a pipe: tran|tran ascii.

The ascii conversion, like any other, leaves characters it doesn't have data for intact, leading to non-ASCII output. This might be what you want if you need to just drop diacritics and expand digraphs, but if you're after pure 7-bit text, use "tran ascii|perl -CIO -pe 'tr /\x1-\x7e/?/c'" (/usr/bin/tr works on bytes not characters).

Not all of your recipients may have all required fonts, especially for Plane 1 scripts. Such support is especially bad on old terminals that use bitmap fonts, such as xterm, text-mode Linux or pre-Windows 10 console.

History

  • Debian 13 (Trixie) to Debian 12 (Bookworm): the text shown here
  • Debian 11 (Bullseye)
  • Debian 10 (Buster)
  • Debian 9 (Stretch)

Bugs

Ancient (ie, non-Unicode) charsets are not supported at all. tran will obliviously write UTF-8 even when inappropriate.

This tool is pretty slow, especially on startup. If this is a problem for anyone, please holler -- I did not optimize it at all.

Author

Adam Borowski ([email protected])

From tran 5-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.