{
    "content": [
        {
            "type": "text",
            "text": "# uconv (man)\n\n## NAME\n\nuconv - convert data from one encoding to another\n\n## SYNOPSIS\n\nuconv  [ -h, -?, --help ] [ -V, --version ] [ -s, --silent ] [ -v, --verbose ] [ -l, --list |\n\n## DESCRIPTION\n\nuconv converts, or transcodes, each given file (or its standard input if no  file  is  speci‐\nfied)  from one encoding to another.  The transcoding is done using Unicode as a pivot encod‐\ning (i.e. the data are first transcoded from their original encoding  to  Unicode,  and  then\nfrom Unicode to the destination encoding).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION**\n- **OPTIONS** (20 subsections)\n- **CALLBACKS**\n- **EXAMPLES**\n- **CAVEATS AND BUGS**\n- **AUTHORS**\n- **VERSION**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "uconv",
        "section": "",
        "mode": "man",
        "summary": "uconv - convert data from one encoding to another",
        "synopsis": "uconv  [ -h, -?, --help ] [ -V, --version ] [ -s, --silent ] [ -v, --verbose ] [ -l, --list |",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-?",
                "long": "--help",
                "arg": null,
                "description": "Print help about usage and exit."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Print the version of uconv and exit."
            },
            {
                "flag": "-s",
                "long": "--silent",
                "arg": null,
                "description": "Suppress messages during execution."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Display extra informative messages during execution."
            },
            {
                "flag": "-l",
                "long": "--list",
                "arg": null,
                "description": "List all the available encodings and exit."
            },
            {
                "flag": "-l",
                "long": "--list-code",
                "arg": null,
                "description": "List only the code encoding and exit. If code is not a proper encoding, exit with an error."
            },
            {
                "flag": "",
                "long": "--default-code",
                "arg": null,
                "description": "List only the name of the default encoding and exit."
            },
            {
                "flag": "-L",
                "long": "--list-transliterators",
                "arg": null,
                "description": "List all the available transliterators and exit."
            },
            {
                "flag": "",
                "long": "--canon",
                "arg": null,
                "description": "If used with -l, --list or --default-code, the list of encodings is produced in a for‐ mat compatible with convrtrs.txt(5). If used with -L, --list-transliterators, print only one transliterator name per line."
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "Run the given transliteration on the transcoded Unicode data, and use the transliter‐ ated data as input for the transcoding to the destination encoding. --to-callback callback Use callback to handle characters that cannot be transcoded to the destination encod‐ ing. See section CALLBACKS for details on valid callbacks."
            },
            {
                "flag": "-c",
                "long": "--to-callback",
                "arg": null,
                "description": "--from-callback callback Use callback to handle characters that cannot be transcoded from the original encod‐ ing. See section CALLBACKS for details on valid callbacks."
            },
            {
                "flag": "-i",
                "long": "--from-callback",
                "arg": null,
                "description": "--callback callback Use callback to handle both characters that cannot be transcoded from the original en‐ coding and characters that cannot be transcoded to the destination encoding. See sec‐ tion CALLBACKS for details on valid callbacks."
            },
            {
                "flag": "",
                "long": "--fallback",
                "arg": null,
                "description": "Use the fallback mapping when transcoding from Unicode to the destination encoding."
            },
            {
                "flag": "",
                "long": "--no-fallback",
                "arg": null,
                "description": "Do not use the fallback mapping when transcoding from Unicode to the destination en‐ coding. This is the default."
            },
            {
                "flag": "-b",
                "long": "--block-size",
                "arg": null,
                "description": "Read input in blocks of size bytes at a time. The default block size is 4096."
            },
            {
                "flag": "-f",
                "long": "--from-code",
                "arg": null,
                "description": "Set the original encoding of the data to encoding."
            },
            {
                "flag": "-t",
                "long": "--to-code",
                "arg": null,
                "description": "Transcode the data to encoding."
            },
            {
                "flag": "",
                "long": "--add-signature",
                "arg": null,
                "description": "Add a U+FEFF Unicode signature character (BOM) if the output charset supports it and does not add one anyway."
            },
            {
                "flag": "",
                "long": "--remove-signature",
                "arg": null,
                "description": "Remove a U+FEFF Unicode signature character (BOM)."
            },
            {
                "flag": "-o",
                "long": "--output",
                "arg": null,
                "description": "Write the transcoded data to file."
            }
        ],
        "examples": [
            "Convert data from a given encoding to the platform encoding:",
            "$ uconv -f encoding",
            "Check if a file contains valid data for a given encoding:",
            "$ uconv -f encoding -c file >/dev/null",
            "Convert a UTF-8 file to a given encoding and ensure that the resulting text is good  for  any",
            "version of HTML:",
            "$ uconv -f utf-8 -t encoding \\",
            "--callback escape-xml-dec file",
            "Display the names of the Unicode code points in a UTF-file:",
            "$ uconv -f utf-8 -x any-name file",
            "Print the name of a Unicode code point whose value is known (U+30AB in this example):",
            "$ echo '\\u30ab' | uconv -x 'hex-any; any-name'; echo",
            "{KATAKANA LETTER KA}{LINE FEED}",
            "(The names are delimited by curly braces.  Also, the name of the line terminator is also dis‐",
            "played.)",
            "Normalize  UTF-8  data using Unicode NFKC, remove all control characters, and map Katakana to",
            "Hiragana:",
            "$ uconv -f utf-8 -t utf-8 \\",
            "-x '::nfkc; [:Cc:] >; ::katakana-hiragana;'"
        ],
        "see_also": [
            {
                "name": "iconv",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/iconv/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-l --list-code _ --default-code  -L --list-transliterators   --canon   -x",
                        "lines": 5,
                        "flag": "-x",
                        "long": "--canon"
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-h -? --help",
                        "lines": 2,
                        "flag": "-?",
                        "long": "--help"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-s --silent",
                        "lines": 2,
                        "flag": "-s",
                        "long": "--silent"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-l --list",
                        "lines": 2,
                        "flag": "-l",
                        "long": "--list"
                    },
                    {
                        "name": "-l --list-code _",
                        "lines": 3,
                        "flag": "-l",
                        "long": "--list-code"
                    },
                    {
                        "name": "--default-code",
                        "lines": 2,
                        "long": "--default-code"
                    },
                    {
                        "name": "-L --list-transliterators",
                        "lines": 2,
                        "flag": "-L",
                        "long": "--list-transliterators"
                    },
                    {
                        "name": "--canon",
                        "lines": 4,
                        "long": "--canon"
                    },
                    {
                        "name": "-x _",
                        "lines": 7,
                        "flag": "-x"
                    },
                    {
                        "name": "-c      --to-callback skip",
                        "lines": 4,
                        "flag": "-c",
                        "long": "--to-callback"
                    },
                    {
                        "name": "-i      --from-callback skip",
                        "lines": 5,
                        "flag": "-i",
                        "long": "--from-callback"
                    },
                    {
                        "name": "--fallback",
                        "lines": 2,
                        "long": "--fallback"
                    },
                    {
                        "name": "--no-fallback",
                        "lines": 3,
                        "long": "--no-fallback"
                    },
                    {
                        "name": "-b --block-size _",
                        "lines": 2,
                        "flag": "-b",
                        "long": "--block-size"
                    },
                    {
                        "name": "-f --from-code _",
                        "lines": 2,
                        "flag": "-f",
                        "long": "--from-code"
                    },
                    {
                        "name": "-t --to-code _",
                        "lines": 2,
                        "flag": "-t",
                        "long": "--to-code"
                    },
                    {
                        "name": "--add-signature",
                        "lines": 3,
                        "long": "--add-signature"
                    },
                    {
                        "name": "--remove-signature",
                        "lines": 2,
                        "long": "--remove-signature"
                    },
                    {
                        "name": "-o --output _",
                        "lines": 2,
                        "flag": "-o",
                        "long": "--output"
                    }
                ]
            },
            {
                "name": "CALLBACKS",
                "lines": 49,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 33,
                "subsections": []
            },
            {
                "name": "CAVEATS AND BUGS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "uconv - convert data from one encoding to another\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "uconv  [ -h, -?, --help ] [ -V, --version ] [ -s, --silent ] [ -v, --verbose ] [ -l, --list |",
                "subsections": [
                    {
                        "name": "-l --list-code _ --default-code  -L --list-transliterators   --canon   -x",
                        "content": "transliteration ] [ --to-callback callback | -c ] [ --from-callback callback | -i ] [ --call‐\nback  callback  ]  [ --fallback | --no-fallback ] [ -b, --block-size size ] [ -f, --from-code\nencoding ] [ -t, --to-code encoding ] [ --add-signature ] [ --remove-signature ] [ -o, --out‐\nput file ] [ file...  ]\n",
                        "flag": "-x",
                        "long": "--canon"
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "uconv converts, or transcodes, each given file (or its standard input if no  file  is  speci‐\nfied)  from one encoding to another.  The transcoding is done using Unicode as a pivot encod‐\ning (i.e. the data are first transcoded from their original encoding  to  Unicode,  and  then\nfrom Unicode to the destination encoding).\n\nIf  an  encoding  is not specified or is -, the default encoding is used. Thus, calling uconv\nwith no encoding provides an easy way to validate and sanitize data files  for  further  con‐\nsumption by tools requiring data in the default encoding.\n\nWhen calling uconv, it is possible to specify callbacks that are used to handle invalid char‐\nacters  in  the  input,  or characters that cannot be transcoded to the destination encoding.\nSome encodings, for example, offer a default substitution character that can be used to  rep‐\nresent  the occurrence of such characters in the input. Other callbacks offer a useful visual\nrepresentation of the invalid data.\n\nuconv can also run the specified transliteration  on  the  transcoded  data,  in  which  case\ntransliteration  will  happen as an intermediate step, after the data have been transcoded to\nUnicode.  The transliteration can be either  a  list  of  semicolon-separated  transliterator\nnames, or an arbitrarily complex set of rules in the ICU transliteration rules format.\n\nFor transcoding purposes, uconv options are compatible with those of iconv(1), making it easy\nto  replace  it  in scripts. It is not necessarily the case, however, that the encoding names\nused by uconv and ICU are the same as the ones used by iconv(1).  Also, options that  provide\ninformational  data,  such  as  the  -l, --list one offered by some iconv(1) variants such as\nGNU's, produce data in a slightly different and easier to parse format.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-h -? --help",
                        "content": "Print help about usage and exit.\n",
                        "flag": "-?",
                        "long": "--help"
                    },
                    {
                        "name": "-V --version",
                        "content": "Print the version of uconv and exit.\n",
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-s --silent",
                        "content": "Suppress messages during execution.\n",
                        "flag": "-s",
                        "long": "--silent"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "Display extra informative messages during execution.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-l --list",
                        "content": "List all the available encodings and exit.\n",
                        "flag": "-l",
                        "long": "--list"
                    },
                    {
                        "name": "-l --list-code _",
                        "content": "List only the code encoding and exit. If code is not a proper encoding, exit  with  an\nerror.\n",
                        "flag": "-l",
                        "long": "--list-code"
                    },
                    {
                        "name": "--default-code",
                        "content": "List only the name of the default encoding and exit.\n",
                        "long": "--default-code"
                    },
                    {
                        "name": "-L --list-transliterators",
                        "content": "List all the available transliterators and exit.\n",
                        "flag": "-L",
                        "long": "--list-transliterators"
                    },
                    {
                        "name": "--canon",
                        "content": "If used with -l, --list or --default-code, the list of encodings is produced in a for‐\nmat  compatible  with convrtrs.txt(5).  If used with -L, --list-transliterators, print\nonly one transliterator name per line.\n",
                        "long": "--canon"
                    },
                    {
                        "name": "-x _",
                        "content": "Run the given transliteration on the transcoded Unicode data, and use the  transliter‐\nated data as input for the transcoding to the destination encoding.\n\n--to-callback callback\nUse  callback to handle characters that cannot be transcoded to the destination encod‐\ning. See section CALLBACKS for details on valid callbacks.\n",
                        "flag": "-x"
                    },
                    {
                        "name": "-c      --to-callback skip",
                        "content": "--from-callback callback\nUse callback to handle characters that cannot be transcoded from the  original  encod‐\ning. See section CALLBACKS for details on valid callbacks.\n",
                        "flag": "-c",
                        "long": "--to-callback"
                    },
                    {
                        "name": "-i      --from-callback skip",
                        "content": "--callback callback\nUse callback to handle both characters that cannot be transcoded from the original en‐\ncoding  and characters that cannot be transcoded to the destination encoding. See sec‐\ntion CALLBACKS for details on valid callbacks.\n",
                        "flag": "-i",
                        "long": "--from-callback"
                    },
                    {
                        "name": "--fallback",
                        "content": "Use the fallback mapping when transcoding from Unicode to the destination encoding.\n",
                        "long": "--fallback"
                    },
                    {
                        "name": "--no-fallback",
                        "content": "Do not use the fallback mapping when transcoding from Unicode to the  destination  en‐\ncoding.  This is the default.\n",
                        "long": "--no-fallback"
                    },
                    {
                        "name": "-b --block-size _",
                        "content": "Read input in blocks of size bytes at a time. The default block size is 4096.\n",
                        "flag": "-b",
                        "long": "--block-size"
                    },
                    {
                        "name": "-f --from-code _",
                        "content": "Set the original encoding of the data to encoding.\n",
                        "flag": "-f",
                        "long": "--from-code"
                    },
                    {
                        "name": "-t --to-code _",
                        "content": "Transcode the data to encoding.\n",
                        "flag": "-t",
                        "long": "--to-code"
                    },
                    {
                        "name": "--add-signature",
                        "content": "Add  a  U+FEFF Unicode signature character (BOM) if the output charset supports it and\ndoes not add one anyway.\n",
                        "long": "--add-signature"
                    },
                    {
                        "name": "--remove-signature",
                        "content": "Remove a U+FEFF Unicode signature character (BOM).\n",
                        "long": "--remove-signature"
                    },
                    {
                        "name": "-o --output _",
                        "content": "Write the transcoded data to file.\n",
                        "flag": "-o",
                        "long": "--output"
                    }
                ]
            },
            "CALLBACKS": {
                "content": "uconv supports specifying callbacks to handle invalid data. Callbacks can be set for both di‐\nrections of transcoding: from the original encoding to Unicode, with the --from-callback  op‐\ntion, and from Unicode to the destination encoding, with the --to-callback option.\n\nThe  following is a list of valid callback names, along with a description of their behavior.\nThe list of callbacks actually supported by uconv is displayed when it  is  called  with  -h,\n--help.\n\nsubstitute       Write the encoding's substitute sequence, or the Unicode replacement charac‐\nter U+FFFD when transcoding to Unicode.\n\nskip             Ignore the invalid data.\n\nstop             Stop  with  an  error  when  encountering invalid data.  This is the default\ncallback.\n\nescape           Same as escape-icu.\n\nescape-icu       Replace the missing characters with a string of the format %Uhhhh for  plane\n0 characters, and %Uhhhh%Uhhhh for planes 1 and above characters, where hhhh\nis  the  hexadecimal  value of one of the UTF-16 code units representing the\ncharacter. Characters from planes 1 and above  are  written  as  a  pair  of\nUTF-16 surrogate code units.\n\nescape-java      Replace  the missing characters with a string of the format \\uhhhh for plane\n0 characters, and \\uhhhh\\uhhhh for planes 1 and above characters, where hhhh\nis the hexadecimal value of one of the UTF-16 code  units  representing  the\ncharacter.  Characters  from  planes  1  and  above are written as a pair of\nUTF-16 surrogate code units.\n\nescape-c         Replace the missing characters with a string of the format \\uhhhh for  plane\n0  characters,  and \\Uhhhhhhhh for planes 1 and above characters, where hhhh\nand hhhhhhhh are the hexadecimal values of the Unicode codepoint.\n\nescape-xml       Same as escape-xml-hex.\n\nescape-xml-hex   Replace the missing characters with a string of the format  &#xhhhh;,  where\nhhhh is the hexadecimal value of the Unicode codepoint.\n\nescape-xml-dec   Replace  the  missing  characters with a string of the format &#nnnn;, where\nnnnn is the decimal value of the Unicode codepoint.\n\nescape-unicode   Replace the missing characters with a string of the format  {U+hhhh},  where\nhhhh  is  the  hexadecimal value of the Unicode codepoint.  That hexadecimal\nstring is of variable length and can use from 4 to 6 digits.   This  is  the\nformat universally used to denote a Unicode codepoint in the literature, de‐\nlimited  by  curly braces for easy recognition of those substitutions in the\noutput.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "Convert data from a given encoding to the platform encoding:\n\n$ uconv -f encoding\n\nCheck if a file contains valid data for a given encoding:\n\n$ uconv -f encoding -c file >/dev/null\n\nConvert a UTF-8 file to a given encoding and ensure that the resulting text is good  for  any\nversion of HTML:\n\n$ uconv -f utf-8 -t encoding \\\n--callback escape-xml-dec file\n\nDisplay the names of the Unicode code points in a UTF-file:\n\n$ uconv -f utf-8 -x any-name file\n\nPrint the name of a Unicode code point whose value is known (U+30AB in this example):\n\n$ echo '\\u30ab' | uconv -x 'hex-any; any-name'; echo\n{KATAKANA LETTER KA}{LINE FEED}\n$\n\n(The names are delimited by curly braces.  Also, the name of the line terminator is also dis‐\nplayed.)\n\nNormalize  UTF-8  data using Unicode NFKC, remove all control characters, and map Katakana to\nHiragana:\n\n$ uconv -f utf-8 -t utf-8 \\\n-x '::nfkc; [:Cc:] >; ::katakana-hiragana;'\n",
                "subsections": []
            },
            "CAVEATS AND BUGS": {
                "content": "uconv does report errors as occurring at the first invalid byte encountered. This may be con‐\nfusing to users of GNU iconv(1), which reports errors as occurring at the first  byte  of  an\ninvalid sequence. For multi-byte character sets or encodings, this means that uconv error po‐\nsitions  may  be  at  a  later  offset  in  the  input stream than would be the case with GNU\niconv(1).\n\nThe reporting of error positions when a transliterator is used may be inaccurate or  unavail‐\nable,  in which case uconv will report the offset in the output stream at which the error oc‐\ncurred.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "Jonas Utterstroem\nYves Arrouye\n",
                "subsections": []
            },
            "VERSION": {
                "content": "74.2\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (C) 2000-2005 IBM, Inc. and others.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "iconv(1)\n\nICU MANPAGE                                  2005-jul-1                                     UCONV(1)",
                "subsections": []
            }
        }
    }
}