Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23411 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5469 invoked by uid 1010); 15 May 2006 19:43:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5454 invoked from network); 15 May 2006 19:42:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2006 19:42:59 -0000 X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.22 relay2.ptmail.sapo.pt Linux 2.4/2.6 Received: from ([212.55.154.22:35540] helo=sapo.pt) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id E5/5E-19568-2C9D8644 for ; Mon, 15 May 2006 15:42:59 -0400 Received: (qmail 11309 invoked by uid 0); 15 May 2006 19:42:53 -0000 Received: from unknown (HELO sapo.pt) (10.134.35.205) by relay2 with SMTP; 15 May 2006 19:42:53 -0000 Received: (qmail 23935 invoked from network); 15 May 2006 19:42:54 -0000 X-AntiVirus: PTMail-AV 0.3-0.88.2 X-Virus-Status: Clean (0.01003 seconds) Received: from unknown (HELO pc07653) (nunoplopes@sapo.pt@[81.193.152.68]) (envelope-sender ) by mta10 (qmail-ldap-1.03) with SMTP for ; 15 May 2006 19:42:54 -0000 Message-ID: <000901c67857$c20fa190$0100a8c0@pc07653> To: "Andrei Zmievski" , "Derick Rethans" Cc: "PHPdev" References: <003d01c672ef$6cde8370$0100a8c0@pc07653> <517361123ef66114064e2866c95e3caa@gravitonic.com> Date: Mon, 15 May 2006 20:42:53 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Subject: Re: [PHP-DEV] [php6] accepting an ascii string only From: nlopess@php.net ("Nuno Lopes") Sorry for the delay. But I think that a new type specifier could be introduced. If not you are saying to extensions writers to duplicate the code below a hundred times: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &name_type) == FAILURE) { return; } if (name_type == IS_UNICODE) { buf = zend_unicode_to_ascii(name, name_len TSRMLS_CC); if (buf == NULL) { php_error(E_WARNING, "my_var has to consist only of ASCII characters"); RETURN_FALSE; } } else { buf = (char *) name; } With a new specifier you would be sure that the string you received was ASCII-only and wouldn't have to care with conversions and such. Nuno > Check out ext/unicode/property.c where zend_unicode_to_ascii() is being > used. > > -Andrei > > On May 9, 2006, at 12:02 AM, Derick Rethans wrote: > >> On Mon, 8 May 2006, Andrei Zmievski wrote: >> >>> There is no way to do it right now. I could see it being useful, though. >>> Anyone else have an opinion on this? >> >> I think we should have a look at it when there is a real need for it as >> I think it's going to be a pain for the users... >> >> Derick