UTF-8 locale portability (and ssh)
Posted
by
kine
on Super User
See other posts from Super User
or by kine
Published on 2012-12-02T22:46:01Z
Indexed on
2012/12/02
23:12 UTC
Read the original article
Hit count: 216
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 FreeBSD. 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?
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)?
© Super User or respective owner