I need to find a list of locale installed/supported in my linux machine. is there a way to find a list of valid locales in my linux using perl ?
thanks
I need to find a list of locale installed/supported in my linux machine. is there a way to find a list of valid locales in my linux using perl ?
thanks
This command will give you a list of locales:
locale -a
From a Perl script you can execute the same using
system("locale -a");
If you want the list of all supported locales, in my Debian distro they are in /usr/share/i18n/SUPPORTED
, so you could do:
system("cat /usr/share/i18n/SUPPORTED");
my @locale_list = `locale -a`;
chomp(@locale_list);
http://perldoc.perl.org/perllocale.html#Finding-locales:
For locales available in your system, consult also setlocale(3) to see whether it leads to the list of available locales (search for the SEE ALSO section). If that fails, try the following command lines:
locale -a
nlsinfo
ls /usr/lib/nls/loc
ls /usr/lib/locale
ls /usr/lib/nls
ls /usr/share/locale