Home  |  Linux  | Mysql  | PHP  | XML
From:Giuseppe Tanzilli - CSF Date:Mon Mar 24 08:02:40 2003
Subject:locale bug from php4.3.0
Hi,
just porting big 4.2.3 application to 4.3.2rc,
I see something changed from 4.3.0 about locale settings.

Before 4.3.0 locale was used to print out numbers in string format
and to read numbers from string formats.
I mean php uses the decimal delimiter definied in the locale settings.

 From 4.3.0 on, php uses the decimal delimiter from locale only to 
output numbers to strings,
not when read numbers from strings.

Why ?

Every other language works the old pre 4.3.0 way.

This way every serious application needs alot of work to run on php 
 >=4.3.0!!!!

Please explain why this change was made.

I saw in setlocale source  in ext/standard/strings.c,
                             if ((lc.decimal_point)[0] != '.') {
                                        /* set locale back to C */
                                        setlocale(LC_NUMERIC, "C");
                                }
this sets  LC_NUMERIC to C in every case

I'm in Italy and here we use comma as decimal delimiter.

bye
Giuseppe



-- 
-------------------------------------------------------
Giuseppe Tanzilli		g.tanzilli@gruppocsf.com
CSF Sistemi srl			phone ++39 0775 7771
Via del Ciavattino 
Anagni FR
Italy


Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
Navigate in group php.dev at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants