U8LOC(1) | General Commands Manual | U8LOC(1) |
u8loc
— run a
program in a UTF-8-capable environment
u8loc |
[-p ] -r
program [args...] |
u8loc |
[-p ] -q
LC_ALL |
u8loc |
[-p ] -q
LANGUAGE |
u8loc |
-q preferred |
u8loc |
-q list |
u8loc |
--features |
The u8loc
utility prepares the environment
variables so that a child process being run will hopefully generate clean
UTF-8 output. It is designed to be run by a program that expects to be able
to reliably parse the output of another program without worrying about
character set conversions.
The u8loc
utility invokes the
locale(1) tool to list the names of the locales for which
the current system has valid definitions, and then filters and reorders
those names based on either a predefined list of language preferences or, if
the -p
option is specified, on the language names
found in the current environment's locale-related variables
(LC_ALL
, LANG
,
LC_MESSAGES
, LC_CTYPE
,
etc.
).
The u8loc
utility accepts the following
command-line options:
-p
-q
LC_ALL
LC_ALL
environment variable.LANGUAGE
LANGUAGE
environment variable.list
-q
option.preferred
-r
LC_ALL
and
LANGUAGE
variables in the environment and execute
the specified program.If the -p
option is specified, the
locale-related environment variables are examined in order. If any of them
contains the name of a locale that specifies UTF-8 as encoding (by either a
“UTF-8 or “utf8 suffix””), the language name is
added to the list of preferences. The variables examined are:
LC_ALL
LANG
LC_MESSAGES
LC_COLLATE
LC_NAME
LC_IDENTIFICATION
LC_CTYPE
LC_NUMERIC
LC_TIME
LC_MONETARY
LC_PAPER
LC_ADDRESS
LC_TELEPHONE
LC_MEASUREMENT
If an error occurs during the detection of a suitable
UTF-8-capable locale, the u8loc
utility will exit
with a non-zero error code. If the -r
option is
specified, the specified program will be executed and replace the
u8loc
process.
Output the name of a UTF-8-capable locale:
u8loc -q LC_ALL
Run a program in a UTF-8-friendly environment:
u8loc -r -- cal -3
No standards documentation was harmed in the process of creating
u8loc
.
Please report any bugs in u8loc
to the
author.
The u8loc
utility was written by
Peter Pentchev ⟨roam@ringlet.net⟩.
February 1, 2021 | Debian |