Bug #722: setlocale: scanner (scanf?) / printf don't work properly
| From: | vogtner at soldan dot de | Date: | Fri, 04 Sep 1998 11:33:25 +0000 |
| Subject: | Bug #722: setlocale: scanner (scanf?) / printf don't work properly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-797@lists.php.net to get a copy of this message | ||
From: vogtner@soldan.de
Operating system: Unix
PHP version: 3.0.3
PHP Bug Type: Misbehaving function
Bug description:
<?
setlocale (LC_ALL, "de_DE"); // or other locale with dec. sep = ,
$v = 3;
$v /= 4;
print $v;
echo $v;
printf ("%7.2f", $v);
?>
If built as apache module, set locale is set global. Successive calls
to print and echo work under the current locale. Printf is never affected
by the locale setting.
After setting the locale code like
$v = 3.4;
is no longer parsed correctly.
$v = 3,4;
is rejected as syntax error. The syntax says "." is the decimal separator, but actually
"," is used. Only
$v = "3,4";
works OK.
I think that calling the C-function setlocale from within php's code is not the right way to
provide locales.
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net