Sign in

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.

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 withTopicWhat differs
Linux, FreeBSD, NetBSDcharmap files for -f and -tOn 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
Linuxomitting both -f and -tOn 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 behaviourSolnix -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 meaningOn 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 //TRANSLITLinux 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
Linuxlong options, -o, -V and --verboseLinux 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 formatThe 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
Linuxenvironment variablesSolnix 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

TaskSolnixLinuxFreeBSDNetBSD
convert a file between character encodingsiconv -f fromcode -t tocode fileiconv -f fromcode -t tocode fileiconv -f fromcode -t tocode fileiconv -f fromcode -t tocode file
convert a file and save the result to another fileiconv -f fromcode -t tocode file > outfileiconv -f fromcode -t tocode -o outfile fileiconv -f fromcode -t tocode file > outfile—
list supported character encodingsiconv -liconv -liconv -liconv -l

Standards

Writing portable scripts

  • Always give both -f and -t with plain codeset names, and redirect output with the shell instead of -o.
  • Do not rely on //TRANSLIT, //IGNORE or the -l output format. Their support and format differ between systems.
  • Do not count on -c dropping bad characters or -s silencing 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.