Re: [RFC] IntlChar class and intl_char_*() functions

From: Date: Thu, 27 Nov 2014 13:48:05 +0000
Subject: Re: [RFC] IntlChar class and intl_char_*() functions
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-79230@lists.php.net to get a copy of this message
> On 27 Nov 2014, at 08:22, Stanislav Malyshev <smalyshev@gmail.com> wrote: > > 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’s 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 “ABC”. If we add that, we should also have an analogue of JavaScript’s String.charCodeAt/String.codePointAt to do the operation in reverse. -- Andrea Faulds http://ajf.me/

« previous php.internals (#79230) next »