Skip to content
EntityQ284678· pop 15· linked from 264 articles

In Unix and Unix-like operating systems, iconv (an abbreviation of internationalization conversion) is a command-line program and a standardized application programming interface (API) used to convert between different character encodings. "It can convert from any of these encodings to any other, through Unicode conversion."

Key facts

Software.name
iconv
Software.author
Hewlett-Packard
Software.developer
Various open-source and commercial developers
Software.repo
https://git.savannah.gnu.org/git/libiconv.git
Software.operating system
Unix, Unix-like, Microsoft Windows, IBM i
Software.platform
Cross-platform
Software.genre
Command
Software.license
libiconv: LGPLiconv: GPLwin-iconv: Public domain

via Wikipedia infobox

Described at

The iconv utility shall convert the encoding of characters in file from one codeset to another and write the results to standard output. When the options indicate that charmap files are used to specify the codesets (see OPTIONS), the codeset conversion shall be accomplished by performing a logical join on the symbolic character names in the two charmaps. The implementation need not support the use of charmap files for codeset conversion unless the POSIX2 LOCALEDEF symbol is defined on the system. Omit any characters that are invalid in the codeset of the input file from the output. When -c is not used, the results of encountering invalid characters in the input stream (either those that are not characters in the codeset of the input file or that have no corresponding character in the codeset of the output file) shall be specified in the system documentation. The presence or absence of -c shall not affect the exit status of iconv . Identify the codeset of the input file. The implementation shall recognize the following two forms of the fromcodeset option-argument: Write all supported fromcode and tocode values to standard output in an unspecified format. Suppress any messages written to standard error concerning invalid characters. When -s is not used, the results of encountering invalid characters in the input stream (either those that are not valid characters in the codeset of the input file or that have no corresponding character in the codeset of the output file) shall be specified in the system documentation. The presence or absence of -s shall not affect the exit status of iconv . Identify the codeset to be used for the output file. The implementation shall recognize the following two forms of the tocodeset option-argument: Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( When the -l option is used, the standard output shall contain all supported fromcode and tocode values, written in an unspecified format. When the -l option is not used, the standard output shall contain the sequence of characters read from the input files, translated to the specified codeset. Nothing else shall be written to the standard output. The user must ensure that both charmap files use the same symbolic names for characters the two codesets have in common. The following example converts the contents of file mail.x400 from the ISO/IEC 6937:1994 standard codeset to the ISO/IEC 8859-1:1998 standard codeset, and stores the results in file mail.local : The iconv utility can be used portably only when the user provides two charmap files as option-arguments. This is because a single charmap provided by the user cannot reliably be joined with the names in a system-provided character set description. The valid values for fromcode and tocode are implementation-defined and do not have to have any relation to the charmap mechanisms. As an aid to interactive users, the -l option was adopted from the Plan 9 operating system. It writes information concerning these implementation-defined values. The format is unspecified because there are many possible useful formats that could be chosen, such as a matrix of valid combinations of fromcode and tocode . The -l option is not intended for shell script usage; conforming applications will have to use charmaps. The iconv utility may support the conversion between ASCII and EBCDIC-based encodings, but is not required to do so. In an XSI-compliant implementation, the dd utility i

Excerpt from a page describing this subject · 10,629 chars · not written by Vinony

Wikidata facts

Show 2 more facts
Sources (2)

via Wikidata · CC0

~3 min read

Article

8 sections
Contents
  • History
  • Implementations
  • Support
  • Ports
  • Usage
  • See also
  • References
  • External links

In Unix and Unix-like operating systems, iconv (an abbreviation of internationalization conversion) is a command-line program and a standardized application programming interface (API) used to convert between different character encodings. "It can convert from any of these encodings to any other, through Unicode conversion."

== History == Initially appearing on the HP-UX operating system,iconv() as well as the utility was standardized within XPG4 and is part of the Single UNIX Specification (SUS).

Connections

Categories