iconv(1) on Solnix vs Linux and the BSDs
A default Solnix system runs the illumos iconv at /usr/bin/iconv, which has only -c, -f, -l, -s and -t, and can take a charmap file path for -f/-t. The published Solnix page describes the GNU-style libiconv iconv (pkgs.solnix.libiconv), which adds long options and substitution options.
The manual pages
- Solnix: iconv(1) from
pkgs.solnix.libiconv - 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
The command on PATH is the illumos /usr/bin/iconv; no other illumos variants are shipped. The published iconv(1) page is for libiconv from pkgs.solnix.libiconv, so its options (--from-code, --to-code, --silent, --unicode-subst, --byte-subst, --widechar-subst) apply only if you install and run that build. The bundle does not say where it installs or whether it shadows /usr/bin/iconv.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| all four | charmap files as -f/-t arguments | illumos iconv treats a -f or -t argument containing a slash as the pathname of a charmap file. If only one of -f/-t is a charmap, or both are omitted, it fails. The Linux, FreeBSD and NetBSD pages describe only codeset names.Source: Solnix (illumos) iconv(1) -f, -t, and the paragraph after -t; Linux iconv(1) -f, -t; FreeBSD iconv(1) -f, -t; NetBSD iconv(1) -f, -t |
| Linux | defaults when -f and -t are omitted | On Linux and in the libiconv page, a missing -f or -t defaults to the locale's encoding. On the default illumos iconv, omitting both is an error, and omitting one is an error when the other is a charmap file.Source: Solnix (illumos) iconv(1) end of OPTIONS; Solnix (libiconv) iconv(1) DESCRIPTION; Linux iconv(1) DESCRIPTION |
| Linux, FreeBSD, NetBSD | long options | The default illumos iconv documents no long options. Linux iconv and the libiconv page have --from-code, --to-code, --silent and --list. The FreeBSD and NetBSD pages document only short options. Scripts using --from-code or --list fail on /usr/bin/iconv unless the manual is incomplete.Source: Solnix (illumos) iconv(1) SYNOPSIS; Solnix (libiconv) iconv(1) OPTIONS; Linux iconv(1) --from-code, --to-code, --list; FreeBSD iconv(1) SYNOPSIS; NetBSD iconv(1) SYNOPSIS |
| Linux | //IGNORE, //TRANSLIT and -o | Linux iconv accepts //IGNORE and //TRANSLIT appended to the to-encoding, and -o/--output and --verbose. Neither Solnix page documents these; redirect standard output instead of using -o.Source: Linux iconv(1) -t, --output, --verbose; Solnix (illumos) iconv(1) OPTIONS; Solnix (libiconv) iconv(1) OPTIONS |
| Linux | -s meaning | On Linux, -s is ignored and kept only for compatibility. On Solnix (both implementations), FreeBSD and NetBSD, -s suppresses messages about invalid or unconvertible characters. FreeBSD and NetBSD describe it as suppressing the count of invalid characters.Source: Linux iconv(1) --silent, -s; Solnix (illumos) iconv(1) -s; Solnix (libiconv) iconv(1) -s; FreeBSD iconv(1) -s; NetBSD iconv(1) -s |
| Linux, FreeBSD, NetBSD | behaviour without -c | FreeBSD and NetBSD output the to_name codeset's invalid-character marker for an unconvertible character unless -c is given. Linux -c discards such characters instead of terminating. The illumos page says only that the result depends on the codesets, and -c does not change the exit status.Source: FreeBSD iconv(1) -c; NetBSD iconv(1) -c; Linux iconv(1) -c; Solnix (illumos) iconv(1) -c |
| Linux, FreeBSD, NetBSD | -c and -s may be ignored (illumos) | The illumos page says -c and -s may be ignored when -f or -t gives a fromcode or tocode name rather than a charmap. The Linux, FreeBSD and NetBSD pages state no such condition.Source: Solnix (illumos) iconv(1) -c, -s; Linux iconv(1) -c, --silent; FreeBSD iconv(1) -c, -s; NetBSD iconv(1) -c, -s |
| all four | substitution options (libiconv only) | --unicode-subst, --byte-subst and --widechar-subst replace unconvertible or invalid input with a printf-style format string. They appear only in the libiconv page. Neither the illumos, Linux, FreeBSD nor NetBSD pages have them.Source: Solnix (libiconv) iconv(1) --unicode-subst, --byte-subst, --widechar-subst; Solnix (illumos), Linux, FreeBSD, NetBSD iconv(1) OPTIONS |
| Linux, FreeBSD, NetBSD | -l output format | The illumos page says the -l output format is unspecified and not for shell scripts. The libiconv page says names are upper case, whitespace-separated, with aliases on the same line. The Linux, FreeBSD and NetBSD pages give no format.Source: Solnix (illumos) iconv(1) NOTES, -l; Solnix (libiconv) iconv(1) DESCRIPTION; Linux iconv(1) --list; FreeBSD iconv(1) -l; NetBSD iconv(1) -l |
| Linux | environment variables | The illumos page lists LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH. Linux documents GCONV_PATH, which selects gconv module configuration directories. The Solnix pages do not mention GCONV_PATH. The FreeBSD and NetBSD pages have no ENVIRONMENT section. Source: Solnix (illumos) iconv(1) ENVIRONMENT VARIABLES; Linux iconv(1) ENVIRONMENT; FreeBSD iconv(1); NetBSD iconv(1) |
| Linux, FreeBSD, NetBSD | exit status | illumos iconv exits 0 on success and 1 on error. Linux says nonzero on errors; FreeBSD and NetBSD say >0. Test for nonzero rather than for exactly 1. Source: Solnix (illumos) iconv(1) EXIT STATUS; Linux iconv(1) EXIT STATUS; FreeBSD iconv(1) EXIT STATUS; NetBSD iconv(1) EXIT STATUS |
Standards
- POSIX: iconv is a POSIX.1-2024 utility.
- Solnix: The illumos page lists Interface Stability: Standard. The libiconv page says CONFORMING TO POSIX:2001.
- Linux: STANDARDS: POSIX.1-2008. HISTORY: POSIX.1-2001.
- 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 pass both
-fand-twith plain codeset names, and use only-c,-sand-l, since those are the options all systems document. - Do not parse iconv
-loutput or rely on //TRANSLIT, //IGNORE,-oor long options; use shell redirection for output and test the exit status for nonzero.
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.