Scroll to navigation

KONWERT(1) Linux User's Manual KONWERT(1)


konwert - interface for various character encoding conversions


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


Konwert allows filtering multiple files through multiple filters. It filters the specified FILEs, or stdin if none are given.

Simple FILTER is the name of an executable file from the directory ~/.konwert/filters or the system-wide one, normally /usr/share/konwert/filters. Such program itself filters stdin to stdout.

The filtering rule can be more complex:

konwert FILTER1+FILTER2 means konwert FILTER1 | konwert FILTER2.

konwert FORMAT1-FORMAT2, unless such filter exists, tries to find a common FORMAT3, such that both filters FORMAT1-FORMAT3 and FORMAT3-FORMAT1 do exist.

konwert FILTER/ARG/... passes arguments to the filter. Arguments can also be specified here: FORMAT1/ARGS-FORMAT2. The meaning of arguments depends on the particular filter.

konwert '(COMMAND ARGS...)' executes this arbitrary shell command. This is useful with -o or -O options. The command cannot contain the string )+, which will terminate this filter's specification.


output goes to this file/directory instead of stdout
every input file is replaced with its translation
display help and exit
output version information and exit

Redirecting output to one of the source files with either -o or > instead of -O will corrupt it! Option -O creates a temporary file in /tmp and later copies it back onto the source.


You can convert text between any two charsets, for example konwert cp437-iso2.

Characters unavailable in the target charset will be substituted with approximations with available ones. The approximations need not be single characters.

The following character sets are currently supported:

7bit ASCII
Unicode UTF-8
iso1 = isolatin1
ISO-8859-1 aka ISO Latin 1 (Western European)
ISO-8859-2 aka ISO Latin 2 (Central European)
ISO-8859-3 aka ISO Latin 3 (Esperanto)
ISO-8859-4 aka ISO Latin 4 (Baltic)
ISO-8859-5 (Cyrillic)
ISO-8859-6 (Arabic)
ISO-8859-7 (Greek)
ISO-8859-8 (Hebrew)
ISO-8859-9 aka ISO Latin 5 (Turkish)
ISO-8859-10 aka ISO Latin 6 (Nordic)
ISO-8859-12 aka ISO Latin 6 (Celtic) - Draft
ISO-8859-13 aka ISO Latin 6 (Baltic) - Draft
ISO-8859-14 aka ISO Latin 6 (Sámi) - Draft
ISO-8859-15 - Draft
KOI8-R (Russian)
KOI8-U (Ukrainian, Byelorussian)
KOI8-Uni (Cyrillic)
cp1250 = wince = winlatin2
Windows CP-1250 aka Win Latin 2 (Central European)
Windows CP-1251 (Cyrillic)
Windows CP-1252 aka Win Latin 1 (Western European)
Windows CP-1253 (Greek)
Windows CP-1254 (Turkish)
Windows CP-1255 (Hebrew)
Windows CP-1256 (Arabic)
Windows CP-1257 (Baltic)
Windows CP-1258 (Vietnamese)
cp437 = icmeng
DOS CP-437 (English)
DOS CP-737 (Greek)
DOS CP-775 (Baltic)
DOS CP-850 aka DOS Latin 1 (Western European)
DOS CP-852 aka DOS Latin 2 (Central European)
DOS CP-855 (Cyrillic)
DOS CP-857 (Turkish)
DOS CP-860 (Portugal)
DOS CP-861 (Icelandic)
DOS CP-862 (Hebrew)
DOS CP-863 (Canadian French)
DOS CP-864 (Arabic)
DOS CP-865 (Nordic)
DOS CP-866 (Russian)
DOS CP-869 (Greek2)
DOS CP-874 (Thai)
Macintosh Roman (Western European)
Macintosh Central European
Macintosh Cyrillic
Macintosh Greek
Macintosh Icelandic
Macintosh Turkish
DOS charsets for Polish
Amiga charsets for Polish
DOS charset for Czech and Slovak
WinGreek (Windows font-based encoding for ancient Greek)
TeX [polish]{babel}: "a"c"e"l"n"o"s"z"r
TeX \prefixing: /a/c/e/l/n/o/s/x/z
Esperanto: cx gx hx jx sx ux (vx w)
Esperanto: ch gh hh jh sh u
Esperanto: ^c ^g ^h ^j ^s ^u (~u)
Esperanto: c^ g^ h^ j^ s^ u^ (u~)
Esperanto: c' g' h' j' s' u'
Esperanto: c` g` h` j` s` u`
VISCII (Vietnamese)
Vietnamese Quoted Readable Implicit
SGML/HTML character references (decimal): Æ ě →
SGML/HTML character references (hexadecimal): Æ ě →
SGML/HTML character entities (names): Æ &ecaron →
All three above (only as input format)
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.
RFC 1345 mnemonics preceded by &
RFC 1345 mnemonics preceded by `
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).
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).
Mixed various Esperanto encodings.


/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.
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.
Convert META as above. Unavailable characters will be encoded in &#Unicode;.
Convert META as above. Unavailable characters will be encoded in hexadecimal &#xUnicode;.
Unavailable characters will be described in TeX. Characters # $ % &  ^ _ { | } ~ resulting from some characters' approximations will be properly escaped into \# \% \& $\backslash$ \^{} \_ \{ $|$ \} \\~{}.
Recognizes some ASCII representations of characters, e.g. (c) ... 1/2 >=.
Russian text will be replaced with its Polish phonetic transcription.

Some output filters can use the language information for choosing better approximations of unavailable letters, for example /de (German): äae instead of a.


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.
Force specific end-of-line marker convention. cr = Macintosh, lf = Unix and Amiga, crlf = Windows and DOS. The input convention is detected automatically.
Expands tabs into spaces (uses the textutils program expand).
Compresses spaces into tabs (uses the textutils program unexpand).
Removes spaces and tabs at end of line.
MIME Quoted Printable encoding: =A3=F3d=BC.
Rich Text Format: \\'a3\\'f3d\\'9f.
Escapes " & < > into SGML/HTML entities &quot; &amp; &lt; &gt;. Useful for including a text file inside HTML <PRE> </PRE> tags.
Guvf vf n qrzbafgengvba bs ebg13.
Self-explanatory. Currently ASCII only.
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.




trs(1), filterm(1)


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.


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


__("< Marcin Kowalczyk *
\__/ 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-
30 Jul 1998 Konwert