On 2013-04-18 20:07:49, XAOC wrote:
Show quoted text> Submitted the attached patch to the GTK-Perl mailing list for comment.
Maybe it's better to use I18N::Langinfo (in perl core since 5.8.0) for checking? After all, it's probably not only LANG which should be checked, but also LC_ALL. And there are also other values to force a 7bit locale, e.g. by using en_GB.US-ASCII. See below for some examples.
BTW, are there other 7bit locales besides US-ASCII?
$ env LANG=de_DE.ISO8859-1 LC_ALL= perl -MI18N::Langinfo=langinfo,CODESET -e 'warn langinfo(CODESET)'
ISO8859-1 at -e line 1.
$ env LANG=de_DE.ISO8859-1 LC_ALL=hr_HR.ISO8859-2 perl -MI18N::Langinfo=langinfo,CODESET -e 'warn langinfo(CODESET)'
ISO8859-2 at -e line 1.
$ env LANG=de_DE.ISO8859-1 LC_ALL=C perl -MI18N::Langinfo=langinfo,CODESET -e 'warn langinfo(CODESET)'
US-ASCII at -e line 1.
$ env LANG=de_DE.ISO8859-1 LC_ALL=POSIX perl -MI18N::Langinfo=langinfo,CODESET -e 'warn langinfo(CODESET)'
US-ASCII at -e line 1.
$ env LANG= LC_ALL= perl -MI18N::Langinfo=langinfo,CODESET -e 'warn langinfo(CODESET)'
US-ASCII at -e line 1.
$ env LANG= LC_ALL=de_DE.UTF-8 perl -MI18N::Langinfo=langinfo,CODESET -e 'warn langinfo(CODESET)'
UTF-8 at -e line 1.
$ env LANG= LC_ALL=en_GB.US-ASCII perl -MI18N::Langinfo=langinfo,CODESET -e 'warn langinfo(CODESET)'
US-ASCII at -e line 1.