[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#63906: debconf doesn't recognize $LANG if it is set to 'de'



On Thu, May 11, 2000 at 02:51:17PM -0700, Joey Hess wrote:
>reassign 63906 perl-5.005
>thanks
>
>Othmar Pasteka wrote:
>> Package: debconf
>> Version: 0.2.80.14
>> Severity: normal
>> 
>> hi,
>> 
>> i just trasnslated apt-setup.temdetes and wanted to test it and found out
>> that it just recognizes my locale setting of LANG if it is de_DE or de_AT
>> or something similar but it won't recognize it if LANG is set just to
>> 'de'. this should probably be fixed.
>
>Either this is a general bug in perl, or this is not a bug. I don't know
>enough about locale settings to say. [...]

>Since perl decides it does not like the locale setting, and resets it,
>debconf never gets a chance to use LANG=de, which is does support fine in its
>own i19n code anyway.

Perl doesn't reset anything.  A call to setlocale which fails does not
change the locale:

    #include <stdlib.h>
    #include <locale.h>

    int main()
    {
	char const *p = setlocale(LC_ALL, "");
	printf("setlocale -> %s\n", p ? p : "FAILED");
	printf("Locale = %s\n", setlocale(LC_ALL, 0));
	return !p;
    }

run with LANG=de:

    setlocale -> FAILED
    Locale = C

The value of LANG is unchanged:

    LANG=de perl -le 'print $ENV{LANG}'

>[...] Furthermore, all other german localized programs I have tried
>(ie: tar, rpm) work fine with LANG=de.

Because they ignore the return value of setlocale whereas Perl moans
about it.

You can supress the warnings by setting the PERL_BADLANG environment
variable.

This should probably be taken up with the glibc/locales maintainer.

Regards,
-- 
Brendan O'Dea                                        bod@compusol.com.au
Compusol Pty. Limited                  (NSW, Australia)  +61 2 9809 0133



Reply to: