I'd run locale -a
and use the string it outputs. On OS X 10.9, I get de_DE.UTF-8
. On Debian 6, I get de_DE.utf8
. dpkg-reconfigure locales
uses de_DE.UTF-8
on the other hand. The safest way is probably to check the return value of setlocale
and try different variants if it fails.
That said, all versions should usually work: with or without dash, uppercase or lowercase.