locale(1) on Solnix vs Linux and the BSDs

On Solnix, locale is the illumos locale at /usr/bin/locale, a POSIX utility with -a, -m, -c and -k. Unlike OpenBSD, whose locale takes a charmap operand and has no -c or -k, Solnix follows the POSIX form. The BSD pages differ on where locales are searched for and on how -m works.

What Solnix runs

A default Solnix system runs the illumos locale at /usr/bin/locale. No other variants are shipped. The page's SEE ALSO points to localedef(1) and locale(7).

Differences

Compared withTopicWhat differs
OpenBSD-c and -k missing, charmap operandOpenBSD locale accepts only -a, -m or a charmap operand, and has no -c or -k. Solnix accepts -c and -k with name operands. On Solnix, charmap is a reserved name operand. OpenBSD's charmap prints the current encoding.
Source: OpenBSD locale(1) SYNOPSIS, charmap; Solnix locale(1) SYNOPSIS, OPERANDS (name, charmap)
OpenBSD-m outputSolnix -m writes the names of available charmaps (see localedef(1)). OpenBSD -m always returns UTF-8 only.
Source: Solnix locale(1) -m; OpenBSD locale(1) -m
FreeBSD, NetBSD-m is emulatedFreeBSD and NetBSD say they do not support charmaps in the POSIX sense and emulate -m from the CODESETs of the available locales. The Solnix page says only that -m writes the names of available charmaps.
Source: FreeBSD locale(1) BUGS; NetBSD locale(1) BUGS; Solnix locale(1) -m
FreeBSD, NetBSDPATH_LOCALE and -aOn FreeBSD and NetBSD, -a respects PATH_LOCALE and uses it instead of the default locale directory. The Solnix page does not mention PATH_LOCALE. It says LANG, LC_* and NLSPATH are used only if -a is not given.
Source: FreeBSD locale(1) -a; NetBSD locale(1) -a; Solnix locale(1) ENVIRONMENT VARIABLES
FreeBSD-k list extensionFreeBSD has a specific keyword, list, used as locale -k list [prefix], to print all available keywords. The Solnix page documents no such keyword.
Source: FreeBSD locale(1) SYNOPSIS, IMPLEMENTATION NOTES; Solnix locale(1) OPERANDS
FreeBSD, NetBSD-c and -k with no operandsOn FreeBSD, -c and -k with no keywords print all defined keywords. NetBSD's synopsis shows keyword as optional. The Solnix synopsis requires one or more name operands for -c and -k.
Source: FreeBSD locale(1) -c, -k; NetBSD locale(1) SYNOPSIS; Solnix locale(1) SYNOPSIS
Linuxlong options and extra flagsLinux locale has long options (--all-locales, --charmaps, --category-name, --keyword-name) and -v, -V, --help and --usage. Solnix documents only -a, -c, -k and -m. Linux -a -v adds LC_IDENTIFICATION data.
Source: Linux locale(1) DESCRIPTION; Solnix locale(1) OPTIONS
Linuxcharmap queryOn Linux the current character set is shown with locale -c charmap. On Solnix, charmap is a reserved name operand, but the page does not describe its output.
Source: Linux locale(1) -m; Solnix locale(1) OPERANDS
all fourLC_CTYPE and LC_COLLATE outputOn Solnix, selecting LC_CTYPE or its keywords writes only values in the range 0x00-0x7f. Selecting LC_COLLATE writes no actual values. The other pages do not describe this limit.
Source: Solnix locale(1) NOTES
FreeBSDenvironment variables not interpretedFreeBSD says LC_CTYPE, LC_MESSAGES and NLSPATH are not interpreted by locale. Solnix lists LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, LC_* and NLSPATH as determining the current locale environment.
Source: FreeBSD locale(1) STANDARDS; Solnix locale(1) ENVIRONMENT VARIABLES

Standards

  • POSIX: locale is a POSIX.1-2024 utility.
  • Solnix: Interface Stability: Standard.
  • Linux: STANDARDS: POSIX.1-2008. HISTORY: POSIX.1-2001.
  • FreeBSD: The locale utility conforms to IEEE Std 1003.1-2004 (“POSIX.1”). The LC_CTYPE, LC_MESSAGES and NLSPATH environment variables are not interpreted.
  • OpenBSD: The locale utility implements a subset of the IEEE Std 1003.1-2008 (“POSIX.1”) specification. It was first standardized in the X/Open Portability Guide Issue 4 (“XPG4”).
  • NetBSD: locale conforms to IEEE Std 1003.1-2001 (“POSIX.1”).

Writing portable scripts

  • Use only locale, locale -a and bare locale -m in portable scripts. OpenBSD has no -c or -k, and its -m always returns UTF-8 only.
  • Do not rely on locale -a ordering or exact names across systems. Check the output of locale -a for the name you need, such as en_US.UTF-8.

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.