{
    "content": [
        {
            "type": "text",
            "text": "# iconv(1) (man)\n\n**Summary:** iconv - convert text from one character encoding to another\n\n**Synopsis:** iconv [options] [-f from-encoding] [-t to-encoding] [inputfile]...\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -f | — | — | Use from-encoding for input characters. |\n| -t | — | — | Use to-encoding for output characters. If the string //IGNORE is appended to to-encoding, characters that cannot be conv |\n| -l | --list | — | List all known character set encodings. |\n| -c | — | — | countering such characters. |\n| -o | — | — | Use outputfile for output. |\n| -s | --silent | — | This option is ignored; it is provided only for compatibility. |\n| — | --verbose | — | Print progress information on standard error when processing multiple files. -?, --help Print a usage summary and exit. |\n| — | --usage | — | Print a short usage summary and exit. |\n| -V | --version | — | Print the version number, license, and disclaimer of warranty for iconv. |\n\n## Examples\n\n- `Convert text from the ISO 8859-15 character encoding to UTF-8:`\n- `$ iconv -f ISO-8859-15 -t UTF-8 < input.txt > output.txt`\n- `The next example converts from UTF-8 to ASCII, transliterating when possible:`\n- `$ echo abc ßß αα €€ ààḃḃçç | iconv -f UTF-8 -t ASCII//TRANSLIT`\n- `abc ss ? EUR abc`\n\n## See Also\n\n- locale(1)\n- uconv(1)\n- nllanginfo(3)\n- charsets(7)\n- iconvconfig(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (8 lines)\n- **OPTIONS** (1 lines) — 9 subsections\n  - -f --from-code= (2 lines)\n  - -t --to-code= (11 lines)\n  - -l --list (2 lines)\n  - -c (2 lines)\n  - -o --output= (2 lines)\n  - -s --silent (2 lines)\n  - --verbose (5 lines)\n  - --usage (2 lines)\n  - -V --version (2 lines)\n- **EXIT STATUS** (2 lines)\n- **ENVIRONMENT** (22 lines)\n- **FILES** (9 lines)\n- **CONFORMING TO** (2 lines)\n- **EXAMPLES** (9 lines)\n- **SEE ALSO** (2 lines)\n- **COLOPHON** (7 lines)\n\n## Full Content\n\n### NAME\n\niconv - convert text from one character encoding to another\n\n### SYNOPSIS\n\niconv [options] [-f from-encoding] [-t to-encoding] [inputfile]...\n\n### DESCRIPTION\n\nThe iconv program reads in text in one encoding and outputs the text in another encoding.  If\nno input files are given, or if it is given as a dash (-), iconv reads from  standard  input.\nIf no output file is given, iconv writes to standard output.\n\nIf  no from-encoding is given, the default is derived from the current locale's character en‐\ncoding.  If no to-encoding is given, the default is derived from the current locale's charac‐\nter encoding.\n\n### OPTIONS\n\n#### -f --from-code=\n\nUse from-encoding for input characters.\n\n#### -t --to-code=\n\nUse to-encoding for output characters.\n\nIf the string //IGNORE is appended to to-encoding, characters that cannot be converted\nare discarded and an error is printed after conversion.\n\nIf the string //TRANSLIT is appended to to-encoding, characters  being  converted  are\ntransliterated  when  needed and possible.  This means that when a character cannot be\nrepresented in the target character set, it can be approximated through one or several\nsimilar  looking  characters.  Characters that are outside of the target character set\nand cannot be transliterated are replaced with a question mark (?) in the output.\n\n#### -l --list\n\nList all known character set encodings.\n\n#### -c\n\ncountering such characters.\n\n#### -o --output=\n\nUse outputfile for output.\n\n#### -s --silent\n\nThis option is ignored; it is provided only for compatibility.\n\n#### --verbose\n\nPrint progress information on standard error when processing multiple files.\n\n-?, --help\nPrint a usage summary and exit.\n\n#### --usage\n\nPrint a short usage summary and exit.\n\n#### -V --version\n\nPrint the version number, license, and disclaimer of warranty for iconv.\n\n### EXIT STATUS\n\nZero on success, nonzero on errors.\n\n### ENVIRONMENT\n\nInternally,  the  iconv  program  uses the iconv(3) function which in turn uses gconv modules\n(dynamically loaded shared libraries) to convert to and from a character set.  Before calling\niconv(3),  the iconv program must first allocate a conversion descriptor using iconvopen(3).\nThe operation of the latter function is influenced by the setting of the GCONVPATH  environ‐\nment variable:\n\n*  If  GCONVPATH is not set, iconvopen(3) loads the system gconv module configuration cache\nfile created by iconvconfig(8) and then, based on the configuration, loads the gconv  mod‐\nules  needed  to  perform  the conversion.  If the system gconv module configuration cache\nfile is not available then the system gconv module configuration file is used.\n\n*  If GCONVPATH is defined (as a colon-separated list of pathnames), the system gconv module\nconfiguration  cache is not used.  Instead, iconvopen(3) first tries to load the configu‐\nration files by searching the directories in GCONVPATH in order, followed by  the  system\ndefault  gconv  module configuration file.  If a directory does not contain a gconv module\nconfiguration file, any gconv modules that it may contain are  ignored.   If  a  directory\ncontains  a  gconv module configuration file and it is determined that a module needed for\nthis conversion is available in the directory, then the needed module is loaded from  that\ndirectory,  the  order  being  such  that the first suitable module found in GCONVPATH is\nused.  This allows users to use custom modules and even replace system-provided modules by\nproviding such modules in GCONVPATH directories.\n\n### FILES\n\n/usr/lib/gconv\nUsual default gconv module path.\n\n/usr/lib/gconv/gconv-modules\nUsual system default gconv module configuration file.\n\n/usr/lib/gconv/gconv-modules.cache\nUsual system gconv module configuration cache.\n\n### CONFORMING TO\n\nPOSIX.1-2001.\n\n### EXAMPLES\n\nConvert text from the ISO 8859-15 character encoding to UTF-8:\n\n$ iconv -f ISO-8859-15 -t UTF-8 < input.txt > output.txt\n\nThe next example converts from UTF-8 to ASCII, transliterating when possible:\n\n$ echo abc ßß αα €€ ààḃḃçç | iconv -f UTF-8 -t ASCII//TRANSLIT\nabc ss ? EUR abc\n\n### SEE ALSO\n\nlocale(1), uconv(1), iconv(3), nllanginfo(3), charsets(7), iconvconfig(8)\n\n### COLOPHON\n\nThis  page  is  part  of  release  5.10 of the Linux man-pages project.  A description of the\nproject, information about reporting bugs, and the latest version of this page, can be  found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nGNU                                          2020-06-09                                     ICONV(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "iconv",
        "section": "1",
        "mode": "man",
        "summary": "iconv - convert text from one character encoding to another",
        "synopsis": "iconv [options] [-f from-encoding] [-t to-encoding] [inputfile]...",
        "flags": [
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": "Use from-encoding for input characters."
            },
            {
                "flag": "-t",
                "long": null,
                "arg": null,
                "description": "Use to-encoding for output characters. If the string //IGNORE is appended to to-encoding, characters that cannot be converted are discarded and an error is printed after conversion. If the string //TRANSLIT is appended to to-encoding, characters being converted are transliterated when needed and possible. This means that when a character cannot be represented in the target character set, it can be approximated through one or several similar looking characters. Characters that are outside of the target character set and cannot be transliterated are replaced with a question mark (?) in the output."
            },
            {
                "flag": "-l",
                "long": "--list",
                "arg": null,
                "description": "List all known character set encodings."
            },
            {
                "flag": "-c",
                "long": null,
                "arg": null,
                "description": "countering such characters."
            },
            {
                "flag": "-o",
                "long": null,
                "arg": null,
                "description": "Use outputfile for output."
            },
            {
                "flag": "-s",
                "long": "--silent",
                "arg": null,
                "description": "This option is ignored; it is provided only for compatibility."
            },
            {
                "flag": "",
                "long": "--verbose",
                "arg": null,
                "description": "Print progress information on standard error when processing multiple files. -?, --help Print a usage summary and exit."
            },
            {
                "flag": "",
                "long": "--usage",
                "arg": null,
                "description": "Print a short usage summary and exit."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Print the version number, license, and disclaimer of warranty for iconv."
            }
        ],
        "examples": [
            "Convert text from the ISO 8859-15 character encoding to UTF-8:",
            "$ iconv -f ISO-8859-15 -t UTF-8 < input.txt > output.txt",
            "The next example converts from UTF-8 to ASCII, transliterating when possible:",
            "$ echo abc ßß αα €€ ààḃḃçç | iconv -f UTF-8 -t ASCII//TRANSLIT",
            "abc ss ? EUR abc"
        ],
        "see_also": [
            {
                "name": "locale",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/locale/1/json"
            },
            {
                "name": "uconv",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/uconv/1/json"
            },
            {
                "name": "nllanginfo",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/nllanginfo/3/json"
            },
            {
                "name": "charsets",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/charsets/7/json"
            },
            {
                "name": "iconvconfig",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/iconvconfig/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-f --from-code=",
                        "lines": 2,
                        "flag": "-f"
                    },
                    {
                        "name": "-t --to-code=",
                        "lines": 11,
                        "flag": "-t"
                    },
                    {
                        "name": "-l --list",
                        "lines": 2,
                        "flag": "-l",
                        "long": "--list"
                    },
                    {
                        "name": "-c",
                        "lines": 2,
                        "flag": "-c"
                    },
                    {
                        "name": "-o --output=",
                        "lines": 2,
                        "flag": "-o"
                    },
                    {
                        "name": "-s --silent",
                        "lines": 2,
                        "flag": "-s",
                        "long": "--silent"
                    },
                    {
                        "name": "--verbose",
                        "lines": 5,
                        "long": "--verbose"
                    },
                    {
                        "name": "--usage",
                        "lines": 2,
                        "long": "--usage"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "CONFORMING TO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COLOPHON",
                "lines": 7,
                "subsections": []
            }
        ]
    }
}