Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Iconv
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Standard UNIX utility}} {{Use dmy dates|date=March 2017}} {{Lowercase|title=iconv}} {{Infobox software | name = iconv | logo = | screenshot = | screenshot size = | caption = | author = [[Hewlett-Packard]] | developer = Various [[open-source software|open-source]] and [[commercial software|commercial]] developers | released = | latest release version = | latest release date = | repo = https://git.savannah.gnu.org/git/libiconv.git | operating system = [[Unix]], [[Unix-like]], [[Microsoft Windows]], [[IBM i]] | platform = [[Cross-platform]] | genre = [[Command (computing)|Command]] | license = libiconv: [[LGPL]]<br/>iconv: [[GPL]]<br />win-iconv: [[Public domain]]<ref>{{cite web |url=https://github.com/win-iconv/win-iconv/blob/master/readme.txt |title = win-iconv/readme.txt at master Β· win-iconv/win-iconv Β· GitHub| website=[[GitHub]] }}</ref> | website = }} In [[Unix]] and [[Unix-like]] operating systems, '''iconv''' (an abbreviation of [[Internationalization and localization|internationalization]] conversion)<ref>{{cite web|url=http://astrostatistics.psu.edu/su07/R/html/base/html/iconv.html|title=R: Convert Character Vector between Encodings|website=astrostatistics.psu.edu|access-date=21 April 2018}}</ref> is a command-line [[computer program|program]]<ref>{{cite web|url=http://pubs.opengroup.org/onlinepubs/9699919799/utilities/iconv.html|title=iconv|website=pubs.opengroup.org|access-date=21 April 2018}}</ref> and a standardized [[application programming interface]] (API)<ref>{{cite web|url=http://www.opengroup.org/onlinepubs/009695399/functions/iconv.html|title=iconv|website=www.opengroup.org|access-date=21 April 2018}}</ref> used to convert between different [[character encoding]]s. "It can convert from any of these encodings to any other, through Unicode conversion."<ref name="gnulibiconv">{{cite web|url=https://www.gnu.org/software/libiconv/|title=libiconv - GNU Project - Free Software Foundation (FSF)|website=www.gnu.org|access-date=21 April 2018}}</ref> == History == Initially appearing on the [[HP-UX]] operating system,<ref>{{cite web|url=http://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/iconv.3C.html|title=iconv(3C)|website=docstore.mik.ua|access-date=21 April 2018}}</ref><code>iconv()</code> as well as the utility was standardized within [[X/Open Portability Guide|XPG4]] and is part of the [[Single UNIX Specification]] (SUS). == Implementations == Most [[Linux distribution]]s provide an implementation, either from the [[GNU]] Standard C Library (included since version 2.1, February 1999), or the more traditional GNU <code>libiconv</code>, for systems based on other Standard C Libraries. The <code>iconv</code> function<ref>{{cite web|title=glibc: iconv/iconv.c|url=https://sourceware.org/git/?p=glibc.git;a=blob;f=iconv/iconv.c|access-date=30 November 2016}}{{Dead link|date=January 2020 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> on both is licensed as [[LGPL]], so it is linkable with closed source applications. Unlike the libraries, the <code>iconv</code> utility is licensed under [[GPL]] in both implementations.<ref>{{cite web|title=glibc: iconv/iconv_prog.c|url=https://sourceware.org/git/?p=glibc.git;a=blob;f=iconv/iconv_prog.c|access-date=30 November 2016}}{{Dead link|date=January 2020 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> 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 <code>iconv</code> function with support for all encodings specified by the [[WHATWG]] Encoding Standard. === Support === Currently, over a hundred different character encodings are supported in the GNU variant.<ref name="gnulibiconv"/> === Ports === Under [[Microsoft Windows]], the iconv library and the utility is provided by GNU's libiconv found in [[Cygwin]]<ref name="cygwin-libiconv-search">{{cite web|title=Cygwin Package Search: libiconv |url=https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libiconv |access-date=30 November 2016 |archive-url=https://archive.today/20161130001530/https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libiconv |archive-date=30 November 2016 |url-status=dead |df=dmy-all }}</ref><!-- Search result pages are perishable. --> and [[GnuWin32]]<ref name="gnuwin32-libiconv">{{cite web|url=http://gnuwin32.sourceforge.net/packages/libiconv.htm|title=LibIconv for Windows|website=gnuwin32.sourceforge.net|access-date=21 April 2018}}</ref> environments; there is also a "purely Win32" implementation called "win-iconv" that uses Windows' built-in routines for conversion.<ref name="win-iconv">{{cite web|title=win32-iconv|url=https://github.com/win-iconv/win-iconv|website=GitHub|access-date=30 November 2016}}</ref> The iconv function is also available for many programming languages. The {{Mono|iconv}} command has also been ported to the [[IBM i]] operating system.<ref>{{cite web |title=IBM System i Version 7.2 Programming Qshell |language=en |author=IBM |website=[[IBM]] |author-link=IBM |url=https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzahz/rzahzpdf.pdf?view=kc |access-date=2020-09-05 }}</ref> == Usage == <code>[[stdin]]</code> can be converted from [[ISO/IEC 8859-1|ISO-8859-1]] to current locale and output to <code>[[stdout]]</code> using:<ref>{{cite web|url=http://www-01.ibm.com/support/knowledgecenter/ssw_aix_53/com.ibm.aix.cmds/doc/aixcmds3/iconv.htm|title=IBM Knowledge Center|website=www-01.ibm.com|access-date=21 April 2018}}</ref> <syntaxhighlight lang="bash"> iconv -f iso-8859-1 </syntaxhighlight> An input file <code>infile</code> can be converted from ISO-8859-1 to UTF-8 and output to output file <code>outfile</code> using: <syntaxhighlight lang="bash"> iconv -f iso-8859-1 -t utf-8 <infile> -o <outfile> </syntaxhighlight> == See also == * [[uconv]] * [[luit]] * [[List of Unix commands]] * [[International Components for Unicode]] == References == {{Reflist}} == External links == {{Wikibooks|Guide to Unix|Commands}} * [http://www.opengroup.org/onlinepubs/009695399/functions/iconv.html iconv() OpenGroup Standards page] * [https://www.gnu.org/software/libiconv/ GNU libiconv], [https://git.savannah.gnu.org/gitweb/?p=libiconv.git code] * [https://code.google.com/p/win-iconv/downloads/list win_iconv] {{Unix commands}} [[Category:HP software]] [[Category:Unix text processing utilities]] [[Category:Unix SUS2008 utilities]] [[Category:IBM i Qshell commands]] [[Category:C POSIX library]] {{Unix-stub}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:Dead link
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Lowercase
(
edit
)
Template:Main other
(
edit
)
Template:Mono
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Template other
(
edit
)
Template:Unix-stub
(
edit
)
Template:Unix commands
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Wikibooks
(
edit
)