Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23422 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46646 invoked by uid 1010); 15 May 2006 21:30:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46631 invoked from network); 15 May 2006 21:30:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2006 21:30:46 -0000 X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.23 relay3.ptmail.sapo.pt Linux 2.4/2.6 Received: from ([212.55.154.23:42573] helo=sapo.pt) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id BE/E3-19568-503F8644 for ; Mon, 15 May 2006 17:30:46 -0400 Received: (qmail 10005 invoked by uid 0); 15 May 2006 21:30:42 -0000 Received: from unknown (HELO sapo.pt) (10.134.35.156) by relay3 with SMTP; 15 May 2006 21:30:42 -0000 Received: (qmail 21489 invoked from network); 15 May 2006 21:30:42 -0000 X-AntiVirus: PTMail-AV 0.3-0.88.2 X-Virus-Status: Clean (0.00635 seconds) Received: from unknown (HELO pc07653) (nunoplopes@sapo.pt@[81.193.154.225]) (envelope-sender ) by mta6 (qmail-ldap-1.03) with SMTP for ; 15 May 2006 21:30:42 -0000 Message-ID: <002401c67866$d1497f50$0100a8c0@pc07653> To: "Andrei Zmievski" Cc: "Derick Rethans" , "PHPdev" References: <003d01c672ef$6cde8370$0100a8c0@pc07653> <517361123ef66114064e2866c95e3caa@gravitonic.com> <000901c67857$c20fa190$0100a8c0@pc07653> <7abd987289270ef00178d1bbf8e32c0b@gravitonic.com> Date: Mon, 15 May 2006 22:30:41 +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") Looking only to the tidy extension: tidy_parse_string tidy_parse_file tidy_repair_string tidy_repair_file tidy_getopt tidy::__constructor tidy::parseFile tidy::parseString I would say that others extensions will need too. Think in charset names, options names, options values, etc.. Nuno > That assumes there are a hundred places where you want to receive an ASCII > string. Are they really that prevalent? > > -Andrei > > On May 15, 2006, at 12:42 PM, Nuno Lopes wrote: > >> 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.