Original author(s)Hewlett-Packard
Operating systemUnix and Unix-like
LicenseLGPL, GPL

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


Initially appearing on the HP-UX operating system,[5]iconv() as well as the utility was standardized within XPG4 and is part of the Single UNIX Specification (SUS). The version of iconv that is part of the GNU C Library was written by Ulrich Drepper.[6]


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, first appeared in December 2004.


Currently, over a hundred different character encodings are supported.[4]


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.


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

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 >outfile

See also


  1. ^ "R: Convert Character Vector between Encodings". astrostatistics.psu.edu. Retrieved 21 April 2018.
  2. ^ "iconv". pubs.opengroup.org. Retrieved 21 April 2018.
  3. ^ "iconv". www.opengroup.org. Retrieved 21 April 2018.
  4. ^ a b "libiconv - GNU Project - Free Software Foundation (FSF)". www.gnu.org. Retrieved 21 April 2018.
  5. ^ "iconv(3C)". docstore.mik.ua. Retrieved 21 April 2018.
  6. ^ https://linux.die.net/man/1/iconv
  7. ^ "glibc: iconv/iconv.c". Retrieved 30 November 2016.
  8. ^ "glibc: iconv/iconv_prog.c". Retrieved 30 November 2016.
  9. ^ "Cygwin Package Search: libiconv". Archived from the original on 30 November 2016. Retrieved 30 November 2016.
  10. ^ "LibIconv for Windows". gnuwin32.sourceforge.net. Retrieved 21 April 2018.
  11. ^ "win32-iconv". GitHub. Retrieved 30 November 2016.
  12. ^ "IBM Knowledge Center". www-01.ibm.com. Retrieved 21 April 2018.

External links

This page was last updated at 2019-11-13 05:43, update this pageView original page

All information on this site, including but not limited to text, pictures, etc., are reproduced on Wikipedia (wikipedia.org), following the . Creative Commons Attribution-ShareAlike License


If the math, chemistry, physics and other formulas on this page are not displayed correctly, please useFirefox or Safari