Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53514 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1492 invoked from network); 22 Jun 2011 13:57:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2011 13:57:23 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.160.42 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.160.42 mail-pw0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:54665] helo=mail-pw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/C3-12605-2C4F10E4 for ; Wed, 22 Jun 2011 09:57:23 -0400 Received: by pwi4 with SMTP id 4so645095pwi.29 for ; Wed, 22 Jun 2011 06:57:19 -0700 (PDT) Received: by 10.142.230.3 with SMTP id c3mr121607wfh.433.1308751038496; Wed, 22 Jun 2011 06:57:18 -0700 (PDT) Received: from [192.168.200.5] (c-50-131-46-20.hsd1.ca.comcast.net [50.131.46.20]) by mx.google.com with ESMTPS id n9sm409002wfk.20.2011.06.22.06.57.14 (version=SSLv3 cipher=OTHER); Wed, 22 Jun 2011 06:57:15 -0700 (PDT) Message-ID: <4E01F4B0.9040804@lerdorf.com> Date: Wed, 22 Jun 2011 06:57:04 -0700 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: Reindl Harald CC: internals@lists.php.net References: <4DFF7A12.8060808@sugarcrm.com> <4E00818C.7040201@lsces.co.uk> <4E008EA3.4000403@lsces.co.uk> <41269.5975f3c3.1308671739.nsm@avilys.eik.lt> <4E00C370.9040803@thelounge.net> <4E00C5D0.9020302@thelounge.net> <57392.5975f3c3.1308676323.nsm@avilys.eik.lt> <4E00DA33.9040504@thelounge.net> <58008.5975f3c3.1308687593.nsm@avilys.eik.lt> <4E00FEAC.3040500@thelounge.net> <52139.5975f3c3.1308720282.nsm@avilys.eik.lt> <4E01CEA0.2090607@thelounge.net> <4E01DE36.40009@thelounge.net> <4E01F0C6.6040401@thelounge.net> <4E01F1E0.4090900@toolpark.com> <4E01F38D.9070307@thelounge.net> In-Reply-To: <4E01F38D.9070307@thelounge.net> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] foreach() for strings From: rasmus@lerdorf.com (Rasmus Lerdorf) On 06/22/2011 06:52 AM, Reindl Harald wrote: > > > Am 22.06.2011 15:45, schrieb Lars Schultz: >> Am 22.06.2011 15:40, schrieb Reindl Harald: >>> and why this will not return true if $str is ISO-8859-1? >> If you RTFM (in your jargon) you would know. >> >> http://ch.php.net/manual/en/function.htmlspecialchars.php (Return value Section) > > i read the fucking manual > >> If the input string contains an invalid code unit sequence within the given charset >> and the ENT_IGNORE flag is not set, then htmlspecialchars() will return an >> empty string. > > so damend NOT ALL CHARACTERS are multibyte and so it will return true for "hello" > so what will you tell me above boy? There is obviously no way to tell if "hello" is UTF-8 or ISO-8859-1. It is technically impossible since the two are identical in that range. And please keep things polite. It is very rare that I warn people about that here, and I will only do it once. -Rasmus