HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

iconv — Convert text from one encoding to another. More information: <https://manned.org/iconv>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandtextfromconvertcliiconvencodingone

Problem

How to use the iconv command: Convert text from one encoding to another. More information: <https://manned.org/iconv>.

Solution

iconv — Convert text from one encoding to another. More information: <https://manned.org/iconv>.

Convert file to a specific encoding, and print to stdout:
iconv {{[-f|--from-code]}} {{from_encoding}} {{[-t|--to-code]}} {{to_encoding}} {{input_file}}


Convert file to the current locale's encoding, and output to a file:
iconv {{[-f|--from-code]}} {{from_encoding}} {{input_file}} > {{output_file}}


List supported encodings:
iconv {{[-l|--list]}}

Code Snippets

Convert file to a specific encoding, and print to `stdout`

iconv {{[-f|--from-code]}} {{from_encoding}} {{[-t|--to-code]}} {{to_encoding}} {{input_file}}

Convert file to the current locale's encoding, and output to a file

iconv {{[-f|--from-code]}} {{from_encoding}} {{input_file}} > {{output_file}}

List supported encodings

iconv {{[-l|--list]}}

Context

tldr-pages: common/iconv

Revisions (0)

No revisions yet.