Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37919 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19333 invoked from network); 27 May 2008 17:32:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 May 2008 17:32:33 -0000 Authentication-Results: pb1.pair.com header.from=andrei@gravitonic.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=andrei@gravitonic.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain gravitonic.com from 209.85.146.179 cause and error) X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 209.85.146.179 wa-out-1112.google.com Received: from [209.85.146.179] ([209.85.146.179:2434] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/A0-15519-0B54C384 for ; Tue, 27 May 2008 13:32:32 -0400 Received: by wa-out-1112.google.com with SMTP id v27so2777869wah.17 for ; Tue, 27 May 2008 10:32:29 -0700 (PDT) Received: by 10.115.18.1 with SMTP id v1mr1619191wai.15.1211909549295; Tue, 27 May 2008 10:32:29 -0700 (PDT) Received: from Macintosh-5.local ( [12.51.40.234]) by mx.google.com with ESMTPS id z15sm16060918pod.13.2008.05.27.10.32.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 May 2008 10:32:27 -0700 (PDT) Message-ID: <483C45A9.3000405@gravitonic.com> Date: Tue, 27 May 2008 10:32:25 -0700 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: Steph Fox CC: Antony Dovgal , internals@lists.php.net References: <7d6e34d80805191240k64cb1ba6k3e8f7a50ddf068c@mail.gmail.com> <4831F27B.7030001@suse.de> <296949B4-D328-49FE-968B-4942B28FE869@pooteeweet.org> <7d6e34d80805191454m69614624v7a05037fa947328e@mail.gmail.com> <698DE66518E7CA45812BD18E807866CE019F60DE@us-ex1.zend.net> <34.64.28995.1BE23384@pb1.pair.com> <02e701c8bab7$19a3dd10$4401a8c0@foxbox> <4833FD5B.2010308@daylessday.org> <003f01c8bb33$81ae5030$4401a8c0@foxbox> <48346ED3.9040505@gravitonic.com> <001501c8bbf6$5702cf50$4401a8c0@foxbox> <48371131.50003@gravitonic.com> <008f01c8bd9d$63f0cde0$4401a8c0@foxbox> In-Reply-To: <008f01c8bd9d$63f0cde0$4401a8c0@foxbox> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum] From: andrei@gravitonic.com (Andrei Zmievski) Steph Fox wrote: > OK, so there are some things that should maybe 'just happen' here, and > also when 'S' is used: > > PHP_NAMED_FUNCTION(php_if_crc32) > { > char *p; > int len, nr; > php_uint32 crcinit = 0; > register php_uint32 crc; > > if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &p, &nr) == > FAILURE) { > return; > } > ... > > Warning: crc32() expects parameter 1 to be strictly a binary string, > Unicode string given in ... > > Surely if a function's *expecting* a binary string it should do a silent > conversion, and only throw a warning if the conversion fails? I don't > see why the onus should always be on the user to adapt to this. No, it shouldn't. Because crc32() and other HMACs depend on the actual bytes, there shouldn't be any automatic conversion. The user needs to pass in the binary string (bytes). -Andrei