Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26468 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97782 invoked by uid 1010); 10 Nov 2006 15:09:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97766 invoked from network); 10 Nov 2006 15:09:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2006 15:09:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.142.136.132 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.142.136.132 msa2-mx.centurytel.net Linux 2.4/2.6 Received: from [209.142.136.132] ([209.142.136.132:52543] helo=msa2-mx.centurytel.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/C8-37447-B0694554 for ; Fri, 10 Nov 2006 10:09:01 -0500 Received: from pc1 (d9-104.rt-bras.wnvl.centurytel.net [69.179.136.104]) by msa2-mx.centurytel.net (8.13.6/8.13.6) with SMTP id kAAF8t9B024877; Fri, 10 Nov 2006 09:08:55 -0600 Message-ID: <028701c704da$247d1fb0$0201a8c0@pc1> To: , "Andrei Zmievski" References: <00f001c7048a$b2967030$0201a8c0@pc1> <434F5AED-4D0B-40EF-9817-A16A2844C5FF@gravitonic.com> Date: Fri, 10 Nov 2006 09:08:55 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Subject: Re: [PHP-DEV] Unicode chars allowed in numbers? From: php_lists@realplain.com ("Matt Wilmas") Hi Andrei, All right, glad I checked. I had a few things in mind to optimize is_numeric_string/unicode, and it's fairly straightforward in _string, but would just make things slower if u_* functions were needed to do the same in _unicode, so I was going to rethink it. Now whatever I come up with can be easily copied to the _unicode version with just minor changes... Thanks, Matt ----- Original Message ----- From: "Andrei Zmievski" Sent: Friday, November 10, 2006 > > Hi Andrei, et al., > > > > I was just looking at README.UNICODE, regarding interpretation of > > numbers: > > "we restrict numbers to consist only of ASCII digits," and "Numeric > > strings > > are supposed to adhere to the same rules." Is it correct to take > > that to > > mean only UChar's with values from '0'-'9'/0x30-0x39 (and 'a'-'z' > > equivalents for bases > 10)? > > Correct. > > > I ask because in zend_u_strtol(), HANDLE_U_NUMERIC() for array > > keys, etc., > > the u_digit() function is used, which also allows non-ASCII, higher- > > value > > digit characters, doesn't it? But then in is_numeric_unicode(), when > > checking for hex numbers, the ASCII values '0' and 'x' are used, > > which is > > what I'd expect after reading README.UNICODE. > > You're correct here again, u_digit() should not be used there. > > -Andrei