iconv(1) on Solnix vs Linux and the BSDs
On Solnix, iconv is the illumos iconv at /usr/bin/iconv, a POSIX utility with only -c, -f, -l, -s and -t that also accepts charmap file paths for -f and -t. Unlike Linux iconv, it documents no long options, no -o and no //TRANSLIT or //IGNORE suffix.
The manual pages
- Solnix: iconv(1) from
pkgs.solnix.illumos-world-man; the default on Solnix · illumos.org - Solnix: iconv(1) from
pkgs.solnix.libiconv; add the package to get it - Linux: iconv(1) man-pages-6.18
- FreeBSD: iconv(1) 15.1-RELEASE
- NetBSD: iconv(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
iconv
What Solnix runs
A default Solnix system runs the illumos iconv at /usr/bin/iconv. No other illumos variants are shipped. A second implementation, iconv(1) from pkgs.solnix.libiconv, is not on PATH by default; add that package to get it. Its page lists GNU-style long options and --unicode-subst, --byte-subst and --widechar-subst, which the illumos page lacks.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD, NetBSD | charmap files for -f and -t | On Solnix, a -f or -t argument containing a slash is read as the pathname of a charmap(7) file. An argument without a slash is a codeset name. The Linux, FreeBSD and NetBSD pages describe only codeset names.Source: illumos iconv(1) OPTIONS -f, -t (frommap, tomap); Linux iconv(1) -f, -t; FreeBSD iconv(1) -f, -t; NetBSD iconv(1) -f, -t |
| Linux | omitting both -f and -t | On Solnix, iconv fails if both -f and -t are omitted, or if one is a charmap file and the other is not. The Linux synopsis makes both optional and defaults each from the locale's encoding.Source: illumos iconv(1) OPTIONS (last paragraph); Linux iconv(1) DESCRIPTION, SYNOPSIS |
| FreeBSD, NetBSD | -c behaviour | Solnix -c omits characters that are invalid or unconvertible, without changing the exit status; without -c the result depends on the codesets. FreeBSD and NetBSD say that without -c iconv writes an "invalid character" of the to_name codeset.Source: illumos iconv(1) -c; FreeBSD iconv(1) -c; NetBSD iconv(1) -c |
| Linux | -s meaning | On Solnix, -s suppresses messages about invalid characters, though the page says it may be ignored when a codeset name is given to -f or -t. On Linux, -s is ignored and exists only for compatibility.Source: illumos iconv(1) -s; Linux iconv(1) --silent, -s |
| Linux | //IGNORE and //TRANSLIT | Linux documents //IGNORE and //TRANSLIT suffixes on the to-encoding. The Solnix page does not document either suffix; it offers -c and says -c may be ignored when fromcode or tocode names are used.Source: Linux iconv(1) -t; illumos iconv(1) -c |
| Linux | long options, -o, -V and --verbose | Linux iconv has --from-code, --to-code, --list, --output/-o, --verbose, --help, --usage and --version/-V. The Solnix illumos page documents only -c, -f, -l, -s and -t, so redirect output with the shell.Source: Linux iconv(1) OPTIONS; illumos iconv(1) SYNOPSIS, OPTIONS |
| Linux | -l output format | The Solnix page says the -l output format is unspecified and not meant for scripts. The pkgs.solnix.libiconv page says it prints upper-case names, with aliases on the same line. The Linux page says only that -l lists the known encodings.Source: illumos iconv(1) NOTES; Solnix iconv(1) from pkgs.solnix.libiconv DESCRIPTION; Linux iconv(1) --list |
| Linux | environment variables | Solnix iconv documents LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH. Linux documents GCONV_PATH for locating gconv modules. The Solnix page does not mention GCONV_PATH. Source: illumos iconv(1) ENVIRONMENT VARIABLES; Linux iconv(1) ENVIRONMENT |
Everyday tasks
| Task | Solnix | Linux | FreeBSD | NetBSD |
|---|---|---|---|---|
| convert a file between character encodings | iconv -f fromcode -t tocode file | iconv -f fromcode -t tocode file | iconv -f fromcode -t tocode file | iconv -f fromcode -t tocode file |
| convert a file and save the result to another file | iconv -f fromcode -t tocode file > outfile | iconv -f fromcode -t tocode -o outfile file | iconv -f fromcode -t tocode file > outfile | — |
| list supported character encodings | iconv -l | iconv -l | iconv -l | iconv -l |
Standards
- POSIX: iconv is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Standard.
- Linux: STANDARDS: POSIX.1-2008.
- FreeBSD: iconv conform to IEEE Std 1003.1-2008 (“POSIX.1”).
- NetBSD: iconv conforms to IEEE Std 1003.1-2001 (“POSIX.1”).
Writing portable scripts
- Always give both
-fand-twith plain codeset names, and redirect output with the shell instead of-o. - Do not rely on //TRANSLIT, //IGNORE or the
-loutput format. Their support and format differ between systems. - Do not count on
-cdropping bad characters or-ssilencing messages: the illumos page says each may be ignored when codeset names are used, and Linux ignores-s.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.