DETOX.TBL(5)

πŸ“¦
version 3.0.1 Β· 3 versions
, in arch rolling, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu stonking

πŸ’– DETOX.TBL πŸ’–

okay bestie, welcome to the detox.tbl page, straight out of the File Formats Manual section of your local man pages πŸŽ€ this is the whole vibe on how you tune the translation tables for detox(1) β€” the little tables that tell detox how to read your characters. let's get into it πŸ¦‹


✨ NAME ✨

detox.tbl β€” translation table for detox(1) πŸ’…


🌸 OVERVIEW 🌸

so detox lets you configure how the safe, ISO-8859-1, and UTF-8 (aka Unicode) filters do their thing πŸ’– and the way you do that is through these text-based translation tables β€” they're literally just text files that let you tune how these character sets get interpreted. no cap, that's the whole concept ✨


πŸŽ€ SYNTAX πŸŽ€

the format is genuinely so simple it's giving main character energy. there are exactly two levels: one for meta data, and one for the actual translations 🌈

  • default _ β€” this sets the default translation for a character. here's the important part tho: if the default is empty or non-existent, that means any unknown character should fall through to the next filter πŸ‘‘ and that's how you can chain multiple translation tables together in a sequence, one after another. iconic, honestly.
  • start β€” marks the start of a value list inside the translation table ✨
  • start lang β€” marks the start of a language specific value list inside the translation table πŸ¦‹
  • end β€” marks the end of a value list inside the translation table 🫢
  • value translation β€” the value can be written in decimal (1), hex (0x01), or octal (01). same rules that apply to sscanf apply here, fr fr. and translation can be a string or a quoted string, with either single or double quotes πŸ’…

πŸ’œ EXAMPLES πŸ’œ

okay so here's a lil peek at part of a safe table, with only a few character replacements specified πŸ“

#
# This is a simple example of a "safe" table.  It only translates 4 characters.
#
# The default is commented out, so any character that is not in this table will
# be ignored.
#

# default   _

#
# This is the main replacement block.  Each line specifies a character and a
# string to replace it with.
#

start
0x09    _tab_           # comments work on lines, too
0x24    _dollar_        # $$$
0x26    _and_           # ampersand
end

#
# Starts an optional, language-specific translation block.  detox will read
# your locale and load the block if the word after start matches the language
# portion of your locale.
#
# In the example here, the character $ will be replaced with "_money_" if the
# user is working in English.  If the user is using a different language, $
# will be replaced with the value configured in the previous block, "_dollar_".
#

start en
0x24    _money_         # money money
end

# EOF

and then you could enable this table in your ~/.detoxrc, hanging out with your other filters πŸ’–

# Sample detoxrc

sequence default {
        safe {
                filename "/home/MYUSERNAME/.local/share/detox/safe.tbl";
        };
        safe;
        wipeup;
};

# EOF

so when detox runs, it'll run the custom safe filter first, then the default safe filter, and then finally the wipeup filter πŸ”₯ head over to detoxrc(5) for more deets on all the various filter types, iykyk ✨


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHORS πŸ‘‘

detox was written by Doug Harple. periodt πŸ’…


okay that's the whole page bestie, you ate that 🫢 this came to you from Debian, dated February 24, 2021 β€” go forth and translate your characters, mwah πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from