chiark / gitweb /
moved to cdimage
[bin.git] / locale-exists
1 #! /bin/sh
2 set -e
3
4 # Takes a locale as the first argument, or assumes $LANG if there are no
5 # arguments. Exits zero if the given locale exists, and non-zero otherwise.
6
7 [ "$1" ] && export LANG="$1"
8 PERL_BADLANG=0 perl -MPOSIX -e 'exit 1 unless setlocale(LANG, "")'