> On 28 Nov 2014, at 06:49, Stanislav Malyshev <smalys...@gmail.com> wrote: > >> 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.
It'd work with codepoints, but it strikes me now that this would be a job for UStrings. We could have u($some_input)->codePointAt(7) alongside u($some_input)[7]. Since UString works with codepoints and is guaranteed to be Unicode, this works. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php