--- /dev/null
+#! /bin/sh
+set -e
+
+# Takes a locale as the first argument, or assumes $LANG if there are no
+# arguments. Exits zero if the given locale exists, and non-zero otherwise.
+
+[ "$1" ] && export LANG="$1"
+PERL_BADLANG=0 perl -MPOSIX -le 'exit 1 unless setlocale(LANG, "")'