KONWERT(1)

๐Ÿ“ฆ
version 1.8 ยท 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– KONWERT ๐Ÿ’–

okay bestie, gather round, because this is konwert โ€” section 1 of the Linux User's Manual โ€” and it is literally the interface for various character encoding conversions. she converts. she slays. let's go ๐Ÿฆ‹


๐ŸŒธ NAME ๐ŸŒธ

konwert โ€” the interface for various character encoding conversions. she's the group chat translator but for bytes, fr fr ๐Ÿ’…

โœจ SYNOPSIS โœจ

konwert FILTER [FILE]... [-o DEST | -O]

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so konwert lets you filter multiple files through multiple filters, which is giving main character energy. It filters the FILEs you hand it, or if you give it none, she reads from stdin like a good listener ๐Ÿซถ

A simple FILTER is just the name of an executable file, and konwert goes looking in the directory ~/.konwert/filters or the system-wide one, which is normally /usr/share/konwert/filters. That program does its own little thing: filters stdin to stdout. simple. iconic. โœจ

But the filtering rule can be way more complex than that, bestie:

  • konwert FILTER1+FILTER2 โ€” this means konwert FILTER1 | konwert FILTER2. piping, but make it fashion ๐Ÿ’ซ
  • konwert FORMAT1-FORMAT2 โ€” unless such a filter already exists, she tries to find a common FORMAT3, such that both filters FORMAT1-FORMAT3 and FORMAT3-FORMAT1 do exist. like finding a mutual friend to relay the message ๐Ÿ˜Œ
  • konwert FILTER/ARG/... โ€” this passes arguments to the filter. You can also specify arguments right here: FORMAT1/ARGS-FORMAT2. What those arguments mean is entirely up to the particular filter โ€” no cap, it's filter-specific.
  • konwert '(COMMAND ARGS...)' โ€” this executes an arbitrary shell command. super useful with the -o or -O options btw. The command cannot contain the string )+, because that string terminates this filter's specification. so don't try it ๐Ÿ’€

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -o DEST โ€” output goes to this file/directory instead of stdout. changing the destination, not the vibe โœจ
  • -O โ€” every input file is replaced with its translation. in-place glow-up ๐Ÿ”ฅ
  • --help โ€” display help and exit. your bestie when you're lost ๐Ÿฅบ
  • --version โ€” output version information and exit. who is she ๐Ÿ’…
bestie listen to me. Redirecting output to one of the source files with either -o or > instead of -O will corrupt it! sobbing, screaming, throwing up ๐Ÿ˜ญ Option -O is the safe queen: she creates a temporary file in /tmp and later copies it back onto the source. Use her. ๐Ÿซถ

๐ŸŒˆ CHARACTER ENCODING CONVERSIONS ๐ŸŒˆ

You can convert text between any two charsets, for example konwert cp437-iso2. yes really, just like that ๐Ÿ’ซ

Characters that don't exist in the target charset will be substituted with approximations made from characters that are available. And ngl, those approximations need not be single characters โ€” they can be whole little strings, she's flexible like that.

The following character sets are currently supported, and yes I'm listing every single one because we don't skip anybody in this house ๐Ÿ’–

  • ascii โ€” 7bit ASCII
  • utf8 = unicode โ€” Unicode UTF-8
  • iso1 = isolatin1 โ€” ISO-8859-1 aka ISO Latin 1 (Western European)
  • iso2 = isolatin2 โ€” ISO-8859-2 aka ISO Latin 2 (Central European)
  • iso3 = isolatin3 โ€” ISO-8859-3 aka ISO Latin 3 (Esperanto)
  • iso4 = isolatin4 โ€” ISO-8859-4 aka ISO Latin 4 (Baltic)
  • iso5 = isolatincyr โ€” ISO-8859-5 (Cyrillic)
  • iso6 = isolatinarabic โ€” ISO-8859-6 (Arabic)
  • iso7 = isolatingreek โ€” ISO-8859-7 (Greek)
  • iso8 = isolatinhebrew โ€” ISO-8859-8 (Hebrew)
  • iso9 = isolatin5 = isolatintur โ€” ISO-8859-9 aka ISO Latin 5 (Turkish)
  • iso10 = isolatin6 = isolatinnordic โ€” ISO-8859-10 aka ISO Latin 6 (Nordic)
  • iso12 = isolatin7 = isolatinceltic โ€” ISO-8859-12 aka ISO Latin 6 (Celtic) - Draft
  • iso13 = isolatin8 = isolatinbaltic โ€” ISO-8859-13 aka ISO Latin 6 (Baltic) - Draft
  • iso14 = isolatin9 = isolatinsami โ€” ISO-8859-14 aka ISO Latin 6 (Sรกmi) - Draft
  • iso15 โ€” ISO-8859-15 - Draft
  • koi8r โ€” KOI8-R (Russian)
  • koi8u โ€” KOI8-U (Ukrainian, Byelorussian)
  • koi8uni โ€” KOI8-Uni (Cyrillic)
  • cp1250 = wince = winlatin2 โ€” Windows CP-1250 aka Win Latin 2 (Central European)
  • cp1251 = wincyr โ€” Windows CP-1251 (Cyrillic)
  • cp1252 = winwest = winlatin1 โ€” Windows CP-1252 aka Win Latin 1 (Western European)
  • cp1253 = wingr โ€” Windows CP-1253 (Greek)
  • cp1254 = wintur โ€” Windows CP-1254 (Turkish)
  • cp1255 = winhebrew โ€” Windows CP-1255 (Hebrew)
  • cp1256 = winarabic โ€” Windows CP-1256 (Arabic)
  • cp1257 = winbaltic โ€” Windows CP-1257 (Baltic)
  • cp1258 = winviet โ€” Windows CP-1258 (Vietnamese)
  • cp437 = icmeng โ€” DOS CP-437 (English)
  • cp737 = dosgreek โ€” DOS CP-737 (Greek)
  • cp775 = dosbaltic โ€” DOS CP-775 (Baltic)
  • cp850 = doswest = doslatin1 โ€” DOS CP-850 aka DOS Latin 1 (Western European)
  • cp852 = dosce = doslatin2 โ€” DOS CP-852 aka DOS Latin 2 (Central European)
  • cp855 = doscyr โ€” DOS CP-855 (Cyrillic)
  • cp857 = dostur โ€” DOS CP-857 (Turkish)
  • cp860 = dosportugal โ€” DOS CP-860 (Portugal)
  • cp861 = dosiceland โ€” DOS CP-861 (Icelandic)
  • cp862 = doshebrew โ€” DOS CP-862 (Hebrew)
  • cp863 = doscanadfr โ€” DOS CP-863 (Canadian French)
  • cp864 = dosarabic โ€” DOS CP-864 (Arabic)
  • cp865 = dosnordic โ€” DOS CP-865 (Nordic)
  • cp866 = dosrussian โ€” DOS CP-866 (Russian)
  • cp869 = dosgreek2 โ€” DOS CP-869 (Greek2)
  • cp874 = dosthai โ€” DOS CP-874 (Thai)
  • mac โ€” Macintosh Roman (Western European)
  • macce โ€” Macintosh Central European
  • maccyr โ€” Macintosh Cyrillic
  • macgreek โ€” Macintosh Greek
  • maciceland โ€” Macintosh Icelandic
  • mactur โ€” Macintosh Turkish
  • csk, cyfromat, dhn, fidomazovia, iea, logic, mazovia, microvex โ€” DOS charsets for Polish
  • amigapl, fat, xjp โ€” Amiga charsets for Polish
  • kamenicky โ€” DOS charset for Czech and Slovak
  • wingreek โ€” WinGreek (Windows font-based encoding for ancient Greek)
  • babelpl โ€” TeX [polish]{babel}: "a"c"e"l"n"o"s"z"r
  • ciachy โ€” TeX \prefixing: /a/c/e/l/n/o/s/x/z
  • xmetodo โ€” Esperanto: cx gx hx jx sx ux (vx w)
  • hmetodo โ€” Esperanto: ch gh hh jh sh u
  • antauxcxap โ€” Esperanto: ^c ^g ^h ^j ^s ^u (~u)
  • postcxap โ€” Esperanto: c^ g^ h^ j^ s^ u^ (u~)
  • apostrofoj โ€” Esperanto: c' g' h' j' s' u'
  • malapostrofoj โ€” Esperanto: c` g` h` j` s` u`
  • viscii โ€” VISCII (Vietnamese)
  • viqri โ€” Vietnamese Quoted Readable Implicit
  • htmldec โ€” SGML/HTML character references (decimal): Æ ě →
  • htmlhex โ€” SGML/HTML character references (hexadecimal): Æ ě →
  • htmlent โ€” SGML/HTML character entities (names): Æ &ecaron →
  • html โ€” All three above (only as input format)
  • tex โ€” TeX with some LaTeX or AMS-TeX extensions. There is no distinction between normal and math mode โ€” you will probably have to insert some $'s manually. yes, manually, sorry bestie ๐Ÿ˜ญ
  • mnemonic โ€” RFC 1345 mnemonics preceded by &
  • mnemonic1 โ€” RFC 1345 mnemonics preceded by `
  • any/LANGUAGE (e.g. any/pl-iso2) โ€” this special input format will detect the encoding automatically, basing on the frequencies of characters found in text. Every language is associated with a set of possible encodings used for it and average frequencies of its letters (excluding ASCII letters). The best fitting encoding is used for conversion. Currently supported languages are cs (Czech), de (German), el (Greek), eo (Esperanto), es (Spanish), fr (French), he (Hebrew), it (Italian), pl (Polish), pt (Portuguese), ru (Russian), and sv (Swedish). she's reading you, divination era ๐Ÿ”ฎโœจ
  • varpl โ€” Mixed Polish ISO-8859-2, CP-1250, and UTF-8. If you are reading Polish newsgroups I suggest putting it as a filter in your newsreader (for speed improvement it's better to call it directly, rather than through konwert).
  • vareo โ€” Mixed various Esperanto encodings.

๐Ÿ’… OPTIONS CONTROLLING THE ABOVE CONVERSIONS ๐Ÿ’…

  • /1 (e.g. konwert iso2-ascii/1) โ€” Each unavailable character will be replaced only with a single approximate char, not string. This is useful with the filterm program or with preformatted text. This option is automatically turned on when a filter is used as output for filterm. one char only, we're being minimal about it ๐ŸŽ€
  • /html โ€” Text is assumed to be HTML. The characters " & < > resulting from other characters' approximations will be properly escaped as &quot; &amp; &lt; &gt;. The <META http-equiv="content-type" content="text/html; charset=..."> header will be fixed if present. escaping queen ๐Ÿ’…
  • /htmldec โ€” Convert META as above. Unavailable characters will be encoded in &#Unicode;.
  • /htmlhex โ€” Convert META as above. Unavailable characters will be encoded in hexadecimal &#xUnicode;.
  • /tex โ€” Unavailable characters will be described in TeX. Characters # $ % & \ ^ _ { | } ~ resulting from some characters' approximations will be properly escaped into \# \$ \% \& $\backslash$ \^{} \_ \{ $|$ \} \~{}.
  • /asciichar โ€” Recognizes some ASCII representations of characters, e.g. (c) ... 1/2 >=.
  • /rosyjski โ€” Russian text will be replaced with its Polish phonetic transcription. iconic crossover event ๐Ÿ”ฅ

Some output filters can use the language information for choosing better approximations of unavailable letters, for example /de (German): รค โ†’ ae instead of a. language-aware, she's cultured ๐Ÿงš

๐Ÿฆ‹ OTHER FILTERS ๐Ÿฆ‹

  • any/LANGUAGE-test โ€” Detects the encoding, but instead of text conversion only shows the encoding's name. The additional option /all shows all possible encodings, sorted from better to worse ones. tarot card reading but for bytes โœจ
  • cr, lf, crlf โ€” Force specific end-of-line marker convention. cr = Macintosh, lf = Unix and Amiga, crlf = Windows and DOS. The input convention is detected automatically. she just knows ๐Ÿซถ
  • expand โ€” Expands tabs into spaces (uses the textutils program expand).
  • unexpand โ€” Compresses spaces into tabs (uses the textutils program unexpand).
  • rmspacesateol โ€” Removes spaces and tabs at end of line. trailing whitespace found DEAD ๐Ÿ’€
  • qp-8bit, 8bit-qp โ€” MIME Quoted Printable encoding: =A3=F3d=BC.
  • rtf-8bit, 8bit-rtf โ€” Rich Text Format: \'a3\'f3d\'9f.
  • txt-htmlchar โ€” Escapes " & < > into SGML/HTML entities &quot; &amp; &lt; &gt;. Useful for including a text file inside HTML <PRE> </PRE> tags.
  • htmlchar-txt โ€” Reverse. yes queen, go back ๐ŸŽ€
  • rot13 โ€” Guvf vf n qrzbafgengvba bs ebg13. (iykyk ๐Ÿ˜Œ)
  • toupper, tolower โ€” Self-explanatory. Currently ASCII only. ngl that "currently" is doing a lot of work.
  • prn7pl โ€” Converts polish chars to control sequences for EPSON-compatible printer. Using only 7-bit chars, backspacing printer's head and vertical positioning chars ,.'`` it creates pseudo-polish glyphs. You can specify options: /nlq (default) which optimizes output for better quality printers and /draft โ€” useful for ex. for 9-nails printer. retro printer era, we respect the ancestors ๐Ÿ–จ๏ธโœจ

๐Ÿ“ FILES ๐Ÿ“

  • /usr/share/konwert/filters/*
  • ~/.konwert/filters/*

๐ŸŒŸ SEE ALSO ๐ŸŒŸ

trs(1), filterm(1)

๐Ÿ™ˆ BUGS ๐Ÿ™ˆ

  • APPLE character in mac* charsets, and CH and ch characters in koi8cs are not preserved in conversion even when they are available. Also they don't respect the /1 option. Reason: they are not in Unicode. look, she's doing her best, they're simply not in Unicode ๐Ÿ˜ญ๐Ÿ’€

okay so legally we gotta do this part and like, we're doing it with love, but we're doing it properly, because bestie, the details matter. ๐Ÿซถ

Konwert is a package for conversion between various character encodings.

Copyright (c) 1998 Marcin 'Qrczak' Kowalczyk

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. โœจ

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

๐Ÿ’€ yes it's the classic GPL boilerplate, no we are not skipping it, and yes "version 2 or later, your call" is genuinely what it says. slay.

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

the icon, the legend, the person who decided character encodings were going to be a vibe:

 __("<   Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.home.ml.org/
 \__/       GCS/M d- s+:-- a21 C+++>+++$ UL++>++++$ P+++ L++>++++$ E->++
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-

that's the signature. that's the whole geek code. we did not edit a single character of it, because it's iconic and it's his. ๐ŸŽ€ QRCZAK ๐ŸŽ€


and that's the whole page, bestie!! ๐Ÿฆ‹ you made it all the way to the bottom, which is genuinely main character energy. this is Konwert, page KONWERT(1), dated 30 Jul 1998 โ€” an absolute classic, fr fr. go convert some encodings, you've earned it. ๐Ÿ’…๐ŸŒธ

๐Ÿ“ฆ where this page comes from