HOME

TheInfoList



OR:

In Unix and Unix-like operating systems, iconv (an abbreviation of
internationalization In economics, internationalization or internationalisation is the process of increasing involvement of enterprises in international markets, although there is no agreed definition of internationalization. Internationalization is a crucial strateg ...
conversion) is a command-line
program Program, programme, programmer, or programming may refer to: Business and management * Program management, the process of managing several related projects * Time management * Program, a part of planning Arts and entertainment Audio * Programm ...
and a standardized
application programming interface An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how t ...
(API) used to convert between different
character encoding Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using digital computers. The numerical values that ...
s. "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 X/Open group (also known as the Open Group for Unix Systems and incorporated in 1987 as X/Open Company, Ltd.) was a consortium founded by several European UNIX systems manufacturers in 1984 to identify and promote open standards in the field of i ...
and is part of the Single UNIX Specification (SUS).


Implementations

Most
Linux distribution A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one ...
s provide an implementation, either from the
GNU GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
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 on both is licensed as
LGPL The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their ow ...
, so it is linkable with closed source applications. Unlike the libraries, the iconv utility is licensed under GPL in both implementations. 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 In computing, uconv is a command-line tool that is bundled with International Components for Unicode that converts text files between different character encodings. It is very similar to the ''iconv'' command that is part of the Single UNIX Specif ...
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.


Support

Currently, over a hundred different character encodings are supported.


Ports

Under Microsoft Windows, the iconv library and the utility is provided by GNU's libiconv found in
Cygwin Cygwin ( ) is a POSIX-compatible programming and runtime environment that runs natively on Microsoft Windows. Under Cygwin, source code designed for Unix-like operating systems may be compiled with minimal modification and executed. The Cygwin i ...
and GnuWin32 environments; there is also a "purely Win32" implementation called "win-iconv" that uses Windows' built-in routines for conversion. The iconv function is also available for many programming languages. The command has also been ported to the IBM i operating system.


Usage

stdin In computer programming, standard streams are interconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdi ...
can be converted from ISO-8859-1 to current locale and output to
stdout In computer programming, standard streams are interconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdi ...
using: 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 -o


See also

*
uconv In computing, uconv is a command-line tool that is bundled with International Components for Unicode that converts text files between different character encodings. It is very similar to the ''iconv'' command that is part of the Single UNIX Specif ...
* luit *
List of Unix commands This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems. List See also * List of ...
* International Components for Unicode


References


External links


iconv() OpenGroup Standards page

GNU libiconv

win_iconv
HP software Unix text processing utilities Unix SUS2008 utilities IBM i Qshell commands C POSIX library {{Unix-stub