[Gambas-user] Gambas called by Apache does not respect LANG?

Benoît Minisini g4mba5 at gmail.com
Sun Feb 20 17:30:09 CET 2022


Le 20/02/2022 à 16:43, Christof Thalhofer a écrit :
> Hi everybody,
> 
> I have a problem with Gambas 3.16.3. I'm playing around with a Gambas 
> program called from an Apache webserver via CGI.
> 
> It contains this piece of code:
> 
> -----------------------------------------------------------
> With Response
>     .ContentType = "text/plain; charset=utf-8"
>     .Begin
>     Print Env["LANG"] & " " & Format(Date(2000, 7, 1), "mmmm")
>     .End
> End With
> -----------------------------------------------------------
> 
> which outputs the content of the $LANG environment variable and the 
> formatted string of the month 'July'.
> 
> But even though Apache started the program with the env variable $LANG 
> set to 'de_DE.UTF-8' it prints wrong:
> 
> 'de_DE.UTF-8 July'
> 
> instead of the correct
> 
> 'de_DE.UTF-8 Juli'
> 
> What am I doing wrong? Thanks in advance.
> 
> Alles Gute
> 
> Christof Thalhofer
> 

I don't know. In the past, both $LANG and $LC_ALL had to be set to the 
requested language, but now, at least on my Ubuntu 21.10, only $LANG is 
set. To 'fr_FR.UTF-8' on my system. And I have the '$LANGUAGE' variable 
set to 'fr' (I don't know why these two variables).

Try to set the '$LANGUAGE' variable, or set '$LC_ALL' to 'de_DE.UTF-8', 
to see if it changes anything.

Regards,

-- 
Benoît Minisini


More information about the User mailing list