From:             mats2 at nerdlabs dot org
Operating system: Linux, Debian 3.0
PHP version:      4.3.0
PHP Bug Type:     Gettext related
Bug description:  Setlocale(LC_ALL,"swedish") does not work

Running php 4.3.0/apache 1.3.27 on debian 3.0 (php & apache downloaded and
compiled from non-debian sources) I've run into a problem with
setlocale().

After a few hours trying to use gettext() to add swedish support to a site
i discovered that the combination LC_ALL and sv_SE/swedish for setlocale()
does not work. Almost all other combinations of LC_'s and languages I've
tried works as expected. 

This short test script:

<?php
echo "LC_MESSAGES,swedish = ".setlocale(LC_MESSAGES,"swedish")."<br>";
echo "LC_MESSAGES,sv_SE = ".setlocale(LC_MESSAGES,"sv_SE")."<br>";
echo "LC_MESSAGES,danish = ".setlocale(LC_MESSAGES,"danish")."<br>";

echo "LC_ALL,swedish = ".setlocale(LC_ALL,"swedish")."<br>";
echo "LC_ALL,sv_SE = ".setlocale(LC_ALL,"sv_SE")."<br>";
echo "LC_ALL,danish = ".setlocale(LC_ALL,"danish")."<br>";

echo "LC_NUMERIC,swedish = ".setlocale(LC_NUMERIC,"swedish")."<br>";
echo "LC_NUMERIC,sv_SE = ".setlocale(LC_NUMERIC,"sv_SE")."<br>";
echo "LC_NUMERIC,danish = ".setlocale(LC_NUMERIC,"danish")."<br>";
?>

Returns the followning result:

LC_MESSAGES,swedish = swedish
LC_MESSAGES,sv_SE = sv_SE
LC_MESSAGES,danish = danish
LC_ALL,swedish = 
LC_ALL,sv_SE = 
LC_ALL,danish = danish
LC_NUMERIC,swedish = swedish
LC_NUMERIC,sv_SE = sv_SE
LC_NUMERIC,danish = danish


The config line is:

./configure \
--with-mysql \
--with-apxs=/usr/local/sbin/apxs \
--with-config-file-path=/etc/apache \
--enable-safe-mode \
--with-gettext=/usr/bin \
--with-exec-dir \
--with-xml \
--with-bz2 \
--with-zlib \
--with-gd \
--with-exif \
--with-jpeg-dir=/usr/lib \
--with-png-dir=/usr/lib \
--with-ttf \
--enable-gd-native-ttf 

I've generated _ALL_ locales available on the system.

/Mats
-- 
Edit bug report at http://bugs.php.net/?id=22596&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22596&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22596&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22596&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22596&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22596&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22596&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22596&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22596&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22596&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22596&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22596&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22596&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22596&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22596&r=gnused

Reply via email to