iconv

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

iconv
Original authorHewlett-Packard
DevelopersVarious open-source and commercial developers
Repositoryhttps://git.savannah.gnu.org/git/libiconv.git
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    Operating systemUnix, Unix-like, Microsoft Windows, IBM i
    PlatformCross-platform
    TypeCommand
    Licenselibiconv: LGPL
    iconv: GPL
    win-iconv: Public domain[1]

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

    History

    [edit | edit source]

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

    Implementations

    [edit | edit source]

    Most Linux distributions provide an implementation, either from the GNU Standard C Library (included since version 2.1, February 1999), or the more traditional GNU libiconv, for systems based on other Standard C Libraries.

    The iconv function[7] on both is licensed as LGPL, so it is linkable with closed source applications.

    Unlike the libraries, the iconv utility is licensed under GPL in both implementations.[8] The GNU libiconv implementation is portable, and can be used on various UNIX-like and non-UNIX systems. Version 0.3 dates from December 1999.

    The uconv utility from International Components for Unicode provides an iconv-compatible command-line syntax for transcoding.

    Most BSD systems use NetBSD's implementation, which first appeared in December 2004.

    The musl C library implements the iconv function with support for all encodings specified by the WHATWG Encoding Standard.

    Support

    [edit | edit source]

    Currently, over a hundred different character encodings are supported in the GNU variant.[5]

    Ports

    [edit | edit source]

    Under Microsoft Windows, the iconv library and the utility is provided by GNU's libiconv found in Cygwin[9] and GnuWin32[10] environments; there is also a "purely Win32" implementation called "win-iconv" that uses Windows' built-in routines for conversion.[11] The iconv function is also available for many programming languages.

    The iconv command has also been ported to the IBM i operating system.[12]

    Usage

    [edit | edit source]

    stdin can be converted from ISO-8859-1 to current locale and output to stdout using:[13]

    iconv -f iso-8859-1
    

    An input file infile can be converted from ISO-8859-1 to UTF-8 and output to output file outfile using:

    iconv -f iso-8859-1 -t utf-8 <infile> -o <outfile>
    

    See also

    [edit | edit source]

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    5. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).[permanent dead link]
    8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).[permanent dead link]
    9. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    10. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    11. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    12. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    13. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    [edit | edit source]