I spend a lot of my time ssh
ed into various machines, all of which are different (some are embedded, some run Linux, some run BSD, &c.). On my own local machines, However, I use OS X, which of course has a userland based on BSD. My locale on those machines is set to en_GB.UTF-8
, which is one of the available options:
% echo `sw_vers`
ProductName: Mac OS X ProductVersion: 10.8.2 BuildVersion: 12C60
% locale -a | grep -i 'en_gb.utf'
en_GB.UTF-8
Several of the more-capable Linux systems I use appear to have an equivalent option, but I note that on Linux the name is slightly different:
% lsb_release -d
Description: Debian GNU/Linux 6.0.3 (squeeze)
% locale -a | grep -i 'en_gb.utf'
en_GB.utf8
This makes me wonder: When I ssh
into a Linux machine from my Mac, and it forwards all of my LC_*
variables with that 'UTF-8' suffix, does that Linux machine even understand what is being asked of it? Or is it just falling back to some other locale?
Here is an example of what I'm referring to:
% ssh -v odin
...
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_ALL = en_GB.UTF-8
debug1: Sending env LC_COLLATE = en_GB.UTF-8
debug1: Sending env LC_CTYPE = en_GB.UTF-8
debug1: Sending env LC_MESSAGES = en_GB.UTF-8
debug1: Sending env LC_MONETARY = en_GB.UTF-8
debug1: Sending env LC_NUMERIC = en_GB.UTF-8
debug1: Sending env LC_TIME = en_GB.UTF-8
debug1: Sending env LANG = en_GB.UTF-8
odin:~ % locale | tail -1 # locale is set to .UTF-8 without error...
LC_ALL=en_GB.UTF-8
odin:~ % locale -a | grep 'en_GB.UTF-8' # ... even though .UTF-8 isn't an option
odin:~ %
In either case, what is the mechanism behind its behaviour, and is it dependent on any particular set-up (e.g., will I see the same behaviour on a BusyBox-based system as on a GNU-based one)?