Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79216 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71403 invoked from network); 27 Nov 2014 08:21:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2014 08:21:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.42 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.42 mail-pa0-f42.google.com Received: from [209.85.220.42] ([209.85.220.42:38335] helo=mail-pa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/E3-40216-4FED6745 for ; Thu, 27 Nov 2014 03:21:08 -0500 Received: by mail-pa0-f42.google.com with SMTP id et14so4588400pad.29 for ; Thu, 27 Nov 2014 00:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=E/Sh6cUSbO1oeg62hURhsMfDtrf0hs5Xseink1BA0UU=; b=lUWuyEm7JxAYJrVrk3t+cK3DDE6UCk7h5XyCJLA17GFqAa4W4rhLv3IZiDnBMtXyMv 0AywESyphUIBqQGcCXB4NQSXBQQx7KjWem70Lz3JVa80YjxxEjhFWoI0fQ8susFdQzpS +piWjlBxb2WGWCYhta/QNhk3jcQJArkQv741/cyfZjWkMET9UC9UuA9V/d4rh/5OJZpR VJPxuwy1QGYqq5FNcPE89JtrEpXkTbzmxxmw1u8pnR5+C+3mq9FXDKXENcPZifps+2sK TjC8b7tttucJHONmtUbTEGAe6eTuscqRGzH6HZjCB5qJ/Z5D7b9jpfulSLM5ktfue3aY m1hg== X-Received: by 10.66.165.200 with SMTP id za8mr61686064pab.156.1417076465508; Thu, 27 Nov 2014 00:21:05 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id qn1sm6369663pdb.42.2014.11.27.00.21.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 00:21:04 -0800 (PST) Message-ID: <5476DEEF.5020201@gmail.com> Date: Thu, 27 Nov 2014 00:21:03 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Dmitry Stogov , Andrea Faulds CC: PHP Internals References: <24EE758F-BF8F-4AE9-B793-20739CD9875D@ajf.me> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Unicode Escape Syntax From: smalyshev@gmail.com (Stanislav Malyshev) 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 smalyshev@gmail.com