recode is a text conversion utility . It is intended mainly for converting text files to another encoding ; it can also change the format of line feeds . Comes with many Linux based systems .
| recode | |
|---|---|
| Type of | text transcoding |
| Developer | Francois Pinard |
| operating system | UNIX-like |
| Latest version | 3.6 ( 2001 ) |
| License | GNU GPL |
Features
It does not use ordinary text conversion libraries , but is based on its own logic. Unlike utilities (and libraries) like iconv , recode can convert characters whose exact equivalent is not found in the output character set.
Syntax
Transcoding parameters are indicated as
recode input_encoding .. output_encoding
If a file name (or several names) is specified, then the file (s) are transcoded. If the file name is not specified, then standard input is read, and the result is written to standard output .
Examples
Changes the encoding of the file list from UTF-8 (Linux) to CP1251 (Windows), adjusts the line feed
find * | recode UTF-8..CP1251 / CR-LF> list.txt
Dump
If instead of the name of the output encoding you set the word dump , then a list of all the characters sent to the input is displayed, one on each line. For each character, a Unicode code, two-letter mnemonics (if any) and the name of the character are indicated.
Links
- Official recode page on the GNU website
- The source code of the program on the github website
- recode (1 )
- RFC 1345: Character Mnemonics & Character Sets