Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79230 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6697 invoked from network); 27 Nov 2014 13:48:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2014 13:48:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:60813] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/72-27910-C9B27745 for ; Thu, 27 Nov 2014 08:48:12 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id D0D612400E8; Thu, 27 Nov 2014 08:48:09 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id C6t0GrgfNKhU; Thu, 27 Nov 2014 08:48:09 -0500 (EST) Received: from oa-res-27-210.wireless.abdn.ac.uk (oa-res-27-210.wireless.abdn.ac.uk [137.50.27.210]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 2C2FB2400C3; Thu, 27 Nov 2014 08:48:07 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <5476DF5C.6040807@gmail.com> Date: Thu, 27 Nov 2014 13:48:05 +0000 Cc: Sara Golemon , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <54767CAC.9060608@gmail.com> <5476DF5C.6040807@gmail.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] IntlChar class and intl_char_*() functions From: ajf@ajf.me (Andrea Faulds) > On 27 Nov 2014, at 08:22, Stanislav Malyshev = wrote: >=20 > Looking into this and also reading the \u{} proposal, I also thought - > do we have a programmatic way of doing what \u would do? I.e. if we > assume $x holds an Unicode codepoint value (i.e., an integer) do we = have > a good built-in way to generate the corresponding utf8 sequence? > If not, then I think this class may be a good place to put such a > function in. You mean something along the lines of JavaScript=E2=80=99s = String.fromCharCode (or, in ES6, String.fromCodePoint)? 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 =E2=80=9CABC=E2= =80=9D. If we add that, we should also have an analogue of JavaScript=E2=80=99s = String.charCodeAt/String.codePointAt to do the operation in reverse. -- Andrea Faulds http://ajf.me/