Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60881 invoked from network); 25 Nov 2014 10:41:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2014 10:41:54 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.174 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.174 mail-vc0-f174.google.com Received: from [209.85.220.174] ([209.85.220.174:57495] helo=mail-vc0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/53-40624-FEC54745 for ; Tue, 25 Nov 2014 05:41:53 -0500 Received: by mail-vc0-f174.google.com with SMTP id id10so118193vcb.33 for ; Tue, 25 Nov 2014 02:41:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=G1U/ReoOJqUZZ17j1wCxkUHwHWxZcrXA+CSUqePsEqI=; b=T2d6VKLqIBbr4FOK0RHtuIjGGtYpv/CzeIWhuh4xNRD0UFkjvAoA0whmse0IlxHYi3 b5mwLGtSCxNvITkVlZ3E8E8tXnl7Yj9UzF/LgFlr+NGWPci90vqJ/ASm0nDWXtytfUQR /IHEtHH/HVH042Bwowg25U0IIrxOfoIyIJ3RymE1e9QDf6k8EUWW/e7ABPcrLmSCcTfM wtgkOVywHsgmmmaO/0+dt0S1DuKDxj7+Ce13sol0CSB3ieBp+0QNgwDvDg/AQYlp1RSw aNmBIwu4CitevkWXS7aFG2wPXNO4p7qiYqjw0dFftXlFj+UmNMI7eHvr/Ww6EF92+SDe 5Tig== X-Gm-Message-State: ALoCoQlCy6ehn4GqNZgFktvTDY5687RPGOdNT4DSq0mwOr6b6Ucn4y6/iWDuMbsDbSGswjXW8DTg7RjNaQxLufFA5EpwqHeQ5BkGv8Qiw701DbjSYvC5Buk2L+Y3ToM/AzcLrYhSYbDOVHwqvA9DtmW8B74XLhcPsA== MIME-Version: 1.0 X-Received: by 10.52.246.7 with SMTP id xs7mr5925781vdc.5.1416912108985; Tue, 25 Nov 2014 02:41:48 -0800 (PST) Received: by 10.52.176.231 with HTTP; Tue, 25 Nov 2014 02:41:48 -0800 (PST) In-Reply-To: <24EE758F-BF8F-4AE9-B793-20739CD9875D@ajf.me> References: <24EE758F-BF8F-4AE9-B793-20739CD9875D@ajf.me> Date: Tue, 25 Nov 2014 14:41:48 +0400 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a1135fa5aef38250508ac8e41 Subject: Re: [PHP-DEV] [RFC] Unicode Escape Syntax From: dmitry@zend.com (Dmitry Stogov) --001a1135fa5aef38250508ac8e41 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Nov 25, 2014 at 1:00 PM, Andrea Faulds wrote: > > > On 25 Nov 2014, at 08:33, Dmitry Stogov wrote: > > > > May be I misunderstood something, but why to introduce unicode escapes > if PHP engine doesn't support Unicode. > > We don't have Unicode strings which are made of codepoints rather than > bytes, sure. But we do usually treat these strings as UTF-8. The idea of > doing this in a language without Unicode strings isn't new, C/C++ have th= e > u8"" syntax for making UTF-8 strings. > u8"string" tells that the whole string is UTF-8 encoded. Your escape Unicode proposal assumes just UTF-8 codepoint, but the whole string encoding is still undefined. > > > Always converting such escapes into UTF-8 encoding, doesn't make any > sense for people who use other encodings for output, databases, etc. > > If you're using other encodings, why do you want to use a Unicode > codepoints? Most Unicode codepoints will not supported by another charact= er > set. > Agree, this Unicode escapes are not going to be used for anything except UTF-8 encoded strings. I'm not completely against it. It's just an incomplete solution. echo "\u{1F602}"; // won't output =F0=9F=98=82 if the output encoding is no= t UTF-8 echo "=D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82 \u{1F602}"; // won't output anyt= hing useful if script encoding is not UTF-8 The second problem present even for European counties that use Windows-1250 codepage. echo "ma=C3=B1ana \u{1F602}"; // won't output anything useful if script encoding is not UTF-8 Thanks. Dmitry. > > -- > Andrea Faulds > http://ajf.me/ > --001a1135fa5aef38250508ac8e41--