Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79369 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93372 invoked from network); 2 Dec 2014 05:25:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2014 05:25:23 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.207 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.207 imap2-2.ox.privateemail.com Received: from [192.64.116.207] ([192.64.116.207:47254] helo=imap2-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 62/F8-32869-24D4D745 for ; Tue, 02 Dec 2014 00:25:22 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 786B28C0087; Tue, 2 Dec 2014 00:25:19 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GJ7Rj_2NxQEQ; Tue, 2 Dec 2014 00:25:19 -0500 (EST) Received: from [137.50.28.227] (oa-res-28-227.wireless.abdn.ac.uk [137.50.28.227]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 0A4BA8C0085; Tue, 2 Dec 2014 00:25:18 -0500 (EST) References: <54767CAC.9060608@gmail.com> <5476DF5C.6040807@gmail.com> <54781B03.9000900@gmail.com> Mime-Version: 1.0 (1.0) In-Reply-To: <54781B03.9000900@gmail.com> Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Message-ID: <5F5E92C4-7E1C-4573-9225-ECDA6434D790@ajf.me> Cc: Sara Golemon , PHP internals X-Mailer: iPhone Mail (12B435) Date: Tue, 2 Dec 2014 05:25:07 +0000 To: Stanislav Malyshev Subject: Re: [PHP-DEV] [RFC] IntlChar class and intl_char_*() functions From: ajf@ajf.me (Andrea Faulds) > On 28 Nov 2014, at 06:49, Stanislav Malyshev wrote: >=20 >> If we add that, we should also have an analogue of JavaScript=92s >> String.charCodeAt/String.codePointAt to do the operation in reverse.=20 >=20 > 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. It'd work with codepoints, but it strikes me now that this would be a job fo= r UStrings. We could have u($some_input)->codePointAt(7) alongside u($some_i= nput)[7]. Since UString works with codepoints and is guaranteed to be Unicod= e, this works. -- Andrea Faulds http://ajf.me/=