Hi!

> I'm not completely against it. It's just an incomplete solution.
> 
> echo "\u{1F602}"; // won't output 😂 if the output encoding is not UTF-8

You can always use iconv/recode to bring it to every encoding you need
(provided it supports full unicode range). I see this as a readability
feature - you can look up 1F602 but it's much harder to understand
what's going on if you have \xF0\x9F\x98\x82 instead. Of course, using
this in non-UTF-8 strings is useless, but my question would be - why
would you code have non-utf8 text literals? I mean, even if you output
in other format - why not use de-facto standard internally? Of course,
there might be legacy reasons - but then one won't use \u.

As an alternative, we may have \u{} which produces utf-8 and another one
which produces current script encoding (and errors out if this code
point is not part of it).
-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to