echo Hello world | tran script
DESCRIPTIONtran 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 something invalid to get the list of supported scripts.
- -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.
CAVEATSThere 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.
BUGSAncient (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.
AUTHORAdam Borowski ([email protected])