# info > recode

---
type: CommandReference
command: recode
mode: info
section: ""
source: info
---

## Quick Reference

- `recode mac` — Convert Macintosh file from stdin to Latin-1 on stdout (filter mode)
- `recode pc` — Convert IBM-PC file from stdin to Latin-1 on stdout
- `recode /qp` — Remove Quoted-Printable encoding from stdin to stdout
- `recode ../qp` — Apply Quoted-Printable encoding to stdin to stdout
- `recode macfile.txt` — Recode `macfile.txt` in place (overwrite mode) from Macintosh to Latin-1
- `recode -f BEFORE..AFTER < input > output` — Force recoding despite errors
- `recode -l` — List all available charsets and surfaces
- `recode -v BEFORE..AFTER < /dev/null` — Show planned recoding steps and quality

## Name

`recode` — recoding library and front-end program to convert files between various coded character sets and surface encodings.

## Synopsis

`recode [OPTION]... [CHARSET | REQUEST [FILE]... ]`

Two modes:
- **Filter mode**: No FILE arguments, reads from stdin, writes to stdout.
- **Overwrite mode**: One or more FILE arguments, each file is recoded in place.

The REQUEST parameter specifies the transformation: `BEFORE..AFTER`, optionally with surfaces (`/`), intermediate charsets, or chained sub-requests separated by commas.

## Options

### Listing options

- `-l[FORMAT]`, `--list[=FORMAT]` — List charsets. With no argument, prints all names. With FORMAT (`decimal`, `octal`, `hexadecimal`, `full`) and a charset name, shows detailed table.
- `-k PAIRS`, `--known=PAIRS` — Identify unknown charset by providing known code pairs: `before_code:after_code`.
- `-h[LANGUAGE/][NAME]`, `--header[=[LANGUAGE/][NAME]]` — Generate a C or Perl source table for the recoding.
- `-T`, `--find-subsets` — Compare all charsets for subset relationships.
- `--version` — Print version and exit.
- `--help` — Print help summary and exit.
- `-C`, `--copyright` — Print copyright information.

### Recoding control

- `-c`, `--colons` — In Texte Easy French, use colon `:` for diaeresis instead of double quote.
- `-g`, `--graphics` — Approximate IBM-PC box-drawing characters with ASCII (implies `-f`).
- `-t`, `--touch` — Update file timestamps even when recoding in place (default: preserve timestamps).
- `-v`, `--verbose` — Print recoding steps and quality to stderr; also prints progress per file.
- `-x CHARSET`, `--ignore=CHARSET` — Disallow recoding path through specified charset.

### Reversibility

- `-f`, `--force` — Proceed despite irreversible recodings or errors; do not abort on error.
- `-q`, `--quiet`, `--silent` — Suppress warning messages about irreversibility and other diagnostics.
- `-s`, `--strict` — Strict mapping: drop characters without explicit mapping (makes recoding irreversible unless `-f` also given).

### Sequencing

- `--sequence=memory` — Use in-memory buffers for intermediate passes.
- `-i`, `--sequence=files` — Use temporary files for intermediate passes (default for overwrite mode).
- `-p`, `--sequence=pipe` — Use Unix pipes to fork parallel processes (default for filter mode).

### Mixed charset input

- `-d`, `--diacritics` — When converting to/from HTML or LaTeX, limit conversion to diacriticised characters only.
- `-S[LANGUAGE]`, `--source[=LANGUAGE]` — Recode only comments and strings (C) or translator comments and `msgstr` strings (PO) in otherwise ASCII source files.

## Examples

**Filter IBM-PC to Latin-1:**
shell
recode pc < input.txt > output.txt
**Recode file in place from Macintosh to Latin-1:**
shell
recode mac myfile.txt
**Remove Quoted-Printable (surface only):**
shell
recode /qp < input.qp > output.txt
**Apply Base64 encoding:**
shell
recode ../b64 < input.txt > output.b64
**Show recoding steps without actual conversion:**
shell
recode -v UTF-8..Latin-1 < /dev/null
**Recode a subset of characters (only diacritics) to HTML:**
shell
recode -d l1..h4 < input.txt > output.html
**Recode only comments and strings in a C source file from UTF-8 to Latin-1:**
shell
recode -S u8..l1 < source.c > output.c
**Force recoding despite errors:**
shell
recode -f u8..l1 < input > output
## See Also

- [iconv(1)](http://localhost/phpMan.php/man/iconv/1/markdown) — character set conversion
- The `recode` library documentation (info pages: `info recode`)
- RFC 1345 — Character Mnemonics & Character Sets

## Exit Codes

- `0` — Success (all recodings completed without error).
- Non-zero — At least one recoding was aborted or an error occurred (unless `-f` was used, which forces completion with non-zero exit if errors remain).