ICONV(1) BSD Reference Manual ICONV(1)
iconv - convert between different codesets
iconv [-cs] [-f fromcs] [-t tocs] [file ...] iconv -l
The iconv utility converts the files (or standard input, if none given) from the encoding specified by fromcs, or the current locale's character set as specified by nl_langinfo(CODESET), to the encoding specified by tocs. If file is a single dash ('-') or absent, iconv reads from the standard input. The result is written to standard output, diagnostics and error messages are written to standard error. The options are as follows: -c Omit any characters that are invalid in the codeset of the in- put file from the output. Normally, byte sequences that are no characters in the input codeset cause iconv to abort with a diagnostic message. If -c is given, they are still diagnosed (unless -s is given as well) but skipped (byte-wise) on read. -f fromcs Identify the codeset of the input file. Processing of IEEE Std 1003.1-2001 ("POSIX") Character Set Description Files is not implemented. If this option is not given, the codeset of the current locale is used. -l Instead of codeset conversion, write a list of supported codesets, separated by newline, to standard output, then exit successfully. -s Suppress any diagnostics written to standard error concerning invalid characters (both in the input codeset and in the out- put codeset, i.e. conversion information losses). Normally, invalid input characters, files that end with an incomplete or invalid character or shift sequence, and inconvertible charac- ters are reported, the latter once per file and in a final summary. -t tocs Identify the codeset of the output file. See -f for semantics.
iconv -f latin1 -t utf-8 file.txt >newfile.txt
Exit status is 0 on success, 1 on general failure, 2 if there is no known way to convert between the codesets given, and 3 if the output buffer is too small (implementation error, contact the developer in that case).
iconv(3), nl_langinfo(3), setlocale(3)
The iconv utility is expected to conform to Version 3 of the Single UNIX Specification. XSI is not supported. POSIX2_LOCALEDEF is not supported. If neither -f nor -t are given, or their arguments are the same or equivalent, input is passed through; invalid characters are not detected. Implementation-specific behaviour is as described in this manual.
iconv appeared in MirOS #10.
The iconv utility and this manual page were written by Thorsten Glaser <firstname.lastname@example.org>. MirOS uses codeset conversion routines from the Citrus project.
In the current implementation, if the output of a buffer is more than 16 times the input buffer size, currently 64 KiB, an error is returned. The GNU extension of //TRANSLIT is not supported by Citrus iconv. Each input file is handled as a separate conversion unit, and the shift state is returned to inital after processing a file. MirOS BSD #10-current November 1, 2006 1
Generated on 2013-10-31 22:57:03 by $MirOS: src/scripts/roff2htm,v 1.77 2013/01/01 20:49:09 tg Exp $
These manual pages and other documentation are copyrighted by their respective writers;
their source is available at our CVSweb,
AnonCVS, and other mirrors. The rest is Copyright © 2002‒2013 The MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.
This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.