Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27260 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73664 invoked by uid 1010); 4 Jan 2007 17:19:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 73649 invoked from network); 4 Jan 2007 17:19:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2007 17:19:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrei@gravitonic.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andrei@gravitonic.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain gravitonic.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from [204.11.219.139] ([204.11.219.139:33472] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/1C-16106-4173D954 for ; Thu, 04 Jan 2007 12:19:16 -0500 Received: from [66.228.175.145] (borndress-lm.corp.yahoo.com [66.228.175.145]) (authenticated bits=0) by lerdorf.com (8.13.8/8.13.8/Debian-3) with ESMTP id l04HJDVH010060; Thu, 4 Jan 2007 09:19:13 -0800 In-Reply-To: <01c901c73002$591dc6e0$0201a8c0@pc1> References: <020801c725ce$fe9fe190$0201a8c0@pc1> <90c8af0c49a1264f019f15b797817313@gravitonic.com> <01c901c73002$591dc6e0$0201a8c0@pc1> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: <7b7100f58b16f2ada86e55f00f8abdbf@gravitonic.com> Content-Transfer-Encoding: 7bit Cc: "php-dev Internals" Date: Thu, 4 Jan 2007 09:19:47 -0800 To: "Matt Wilmas" X-Mailer: Apple Mail (2.624) Subject: Re: [PHP-DEV] The new printf implementation From: andrei@gravitonic.com (Andrei Zmievski) So we should remove locale-awareness then? -Andrei On Jan 4, 2007, at 5:15 AM, Matt Wilmas wrote: > Hi Andrei, > > No, not really... :-) I agree with what you said. Even in > non-Unicode mode > or 5.2, it doesn't seem like making things locale aware which weren't > before > is a good idea (3rd party code that's relying on behavior, etc. which I > think was mentioned elsewhere). > > > Matt > > > ----- Original Message ----- > From: "Andrei Zmievski" > Sent: Wednesday, January 03, 2007 > >> Matt, any replies to this? >> >> -A >> >> On Dec 22, 2006, at 9:53 AM, Andrei Zmievski wrote: >> >>> Especially since POSIX locales are deprecated in Unicode mode. I >>> really don't think printf() should use locale-aware formatting by >>> default. >>> >>> -Andrei >>> >>> On Dec 22, 2006, at 5:42 AM, Matt Wilmas wrote: >>> >>>> Hi all, >>>> >>>> A couple questions regarding the printf changes (internal and >>>> userland) a >>>> couple weeks ago... >>>> >>>> Now the internal %f, %g, and %G are locale-aware, which they weren't >>>> before, >>>> right? Is this how they're supposed to be and simply weren't >>>> before? >>>> (The >>>> locale changes caused Bug #39873 with number_format(), etc.) In >>>> userland >>>> *printf(), %f (as always), %g, and %G are also locale-aware, but, >>>> like >>>> "internally," %e and %E are not? None of it really affects me, just >>>> wanting >>>> to verify desired behavior. :-) >>>> >>>> Second thing is about the g/G specifiers, especially now that >>>> they're >>>> in >>>> userland. It's my understanding that scientific notation should be >>>> used if >>>> the exponent is < -4 or >= the precision. So why with >>>> printf('%.6g', >>>> 1234567890) do I get "1234570000" instead of the expected >>>> "1.23457e+9"? The >>>> former just looks wrong. (One more digit triggers scientific >>>> notation.) >>>> Using: >>>> >>>> ini_set('precision', 6); >>>> echo (double) 1234567890; >>>> >>>> it comes out as expected, both on Windows (where zend_sprintf() >>>> appears to >>>> use the system's sprintf()), and on my Linux host. >>>> >>>> The same issue exists in Unicode mode, with double->Unicode >>>> conversion, >>>> which makes things different depending on unicode.semantics... >>>> >>>> It's a simple fix to make g/G work the way I thought (and think) >>>> they >>>> should. Thoughts? >>>> >>>> >>>> Thanks, >>>> Matt > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php