Using
locale -a on debian:
Quote:
# locale -a
C
C.UTF-8
POSIX
|
but on centos:
Quote:
# locale -a
C
C.utf8
POSIX
|
This came about in a bash script I was writing where I had to check if the
C.UTF-8 locale existed so I could fallback to
en_US.utf8 if not because of distros like arch that don't have UTF-8.
Because I was doing something like
locale -a | grep -i UTF-8 it was returning false on centos because over there its called
C.utf8 without the dash.
Once I discovered the naming different I was about to account for it in my script... but why the inconsistency? How does this not trip up programs from distro to distro, is there a better way to inspect locales instead of
locale -a?