Locale doesnt work when LANG=C under CGI (apache)

  • Thread starter Peter Valdemar Mørch
  • Start date
P

Peter Valdemar Mørch

Hi,

I've read in `perldoc perllocale` about the need to configure LANG or
LC_ALL to get locales to work properly with perl. But when attempting
to develop CGI scripts I do not have control over apache's
configuration that exports the hardcoded environment variable LANG=C.

Is there really no way to get locales to work if LANG=C, or any other
value not mentioned in locale -a?

This script prints $! in french if LANG=en_US or has any other value
from
locale -a, but in english otherwise, e.g. under apache...

#!/usr/bin/perl -w
$ENV{"LANGUAGE"}="fr";
open I, "nonexistant" or print $!;
close I;

Without some sort of workaround, I either have to modify httpd.conf to
export LANG=en_US or use something other than gettext, neither of
which sound exciting...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top