tran(1)

πŸ“¦
version 5 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

✨ tran β€” transcribe between character scripts ✨

okay bestie, sit down, we're talking about tran, the manual page is tran(1) and honestly? it's giving quiet little legend. it converts text between Latin and a whole bunch of other character scripts, and it does it like a filter, so it's super easy to pipe into anything. no cap. πŸ’–


🌸 NAME 🌸

tran β€” transcribe between character scripts πŸ¦‹


🌈 SYNOPSIS 🌈

tran <input

echo Hello world | tran script

like. that's it. that's the whole vibe. 🫢


πŸ’« DESCRIPTION πŸ’«

so tran lets you convert between Latin and a whole bunch of other character scripts. it's a filter, which means it reads standard input and writes to the standard output. classic. iconic. main character energy honestly. πŸ‘‘

you gotta tell it which script you want as the argument. please specify the target script. if you don't give it one, the default is latin. and if you pass list? it gives you the list of supported scripts. the way that works is so convenient fr fr. ✨


πŸ’… OPTIONS πŸ’…

  • -d, --debug β€” marks characters that haven't been touched in color. πŸŽ€ the output has to go to a terminal, or less -R, or literally anything that can understand ANSI colors. no terminal = no pretty colors, sorry bestie 😭

🚨 CAVEATS 🚨

okay so this is the part where we get real. πŸ™ˆ

there is currently no triangulation β€” to go between two scripts other than latin, you need to convert to latin first. that's just how it is right now. πŸ’€

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. that might be exactly what you want if you just need to drop diacritics and expand digraphs. but if you're after pure 7-bit text, use this:

tran ascii|perl -CIO -pe 'tr /\x1-\x7e/?/c'

(and yes, /usr/bin/tr works on bytes not characters, so don't come for me 🌸)

also, not all of your recipients may have all the 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. so like… vibe check your audience first bestie πŸ’œ

πŸ’€ BUGS πŸ’€

ancient (ie, non-Unicode) charsets are not supported at all. and tran will obliviously write UTF-8 even when that's inappropriate. it does not care. it has no thoughts. πŸ™ˆ

also this tool is pretty slow, especially on startup. 😭 if that's a problem for anyone, please holler β€” the author did not optimize it at all. like, zero. none. fr fr.


πŸ‘‘ AUTHOR πŸ‘‘

Adam Borowski (kilobyte@angband.pl) 🫢


and that's the whole page bestie!! this was perl v5.32.1, dated 2021-09-29, and it's the tran(1) manual. go forth and transcribe, you absolute icon. slay. πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from