Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79261 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99928 invoked from network); 28 Nov 2014 06:49:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2014 06:49:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.182 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.182 mail-pd0-f182.google.com Received: from [209.85.192.182] ([209.85.192.182:61464] helo=mail-pd0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/06-59154-80B18745 for ; Fri, 28 Nov 2014 01:49:45 -0500 Received: by mail-pd0-f182.google.com with SMTP id r10so6169965pdi.27 for ; Thu, 27 Nov 2014 22:49:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=TXe8BkSloBDZGEuDSuXOdwoj4w5TQ0BJ8pPtUU4DsYo=; b=B9VEItnmvl5d9VuUSswV5tk1FuIvNgi7gppNkdS890+pVcCMAvBQjJRXbZI0nG8xeV Q7RstvaVZtEAWwYcjjQQZ4nRwn652iSzB/RLbSDNhNzS55lSOrdqoLDpUe8savqxc+z8 yPaLJAVv+ucJWHMf2F6KcReEjZRGCNEOxhHLY9W3vbb+goWQrG6LCjJ1f6tFlP6svG8t xonm0+QvhOA/YeCNFJ2oDGbTvJwehZr1vRK60wL20e49EksdBcFzWgB/eexKvEdkFM/A SfqMNw+fLkMUP5MfPv5Ix452Shv92r1He8PU/OG5ax++NXykkme9ZYkiiMBRj3uAcSIG ZblA== X-Received: by 10.70.15.68 with SMTP id v4mr69390745pdc.21.1417157382100; Thu, 27 Nov 2014 22:49:42 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id ip2sm8828175pbb.61.2014.11.27.22.49.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 22:49:41 -0800 (PST) Message-ID: <54781B03.9000900@gmail.com> Date: Thu, 27 Nov 2014 22:49:39 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Andrea Faulds CC: Sara Golemon , PHP internals References: <54767CAC.9060608@gmail.com> <5476DF5C.6040807@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] IntlChar class and intl_char_*() functions From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > You mean something along the lines of JavaScript’s > String.fromCharCode (or, in ES6, String.fromCodePoint)? Yes, exactly. > One of the nice things about that function is that it can take > multiple codes. So I can do String.fromCodePoint(65, 66, 67) to get > “ABC”. Well, that is nice but if we have it for one we can always use array_map() :) We could make it accept as many code points as we want, of course. > If we add that, we should also have an analogue of JavaScript’s > String.charCodeAt/String.codePointAt to do the operation in reverse. That'd be a bit harder since it's not clear what "at" means there - byte? codepoint? grapheme? what about broken UTF-8 sequences? What if you run this function on non-UTF-8 array? Etc. So this one is trickier, the other direction is easy. -- Stas Malyshev smalyshev@gmail.com