Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102596 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34915 invoked from network); 4 Jul 2018 23:28:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2018 23:28:49 -0000 Authentication-Results: pb1.pair.com header.from=david.proweb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=david.proweb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.180 as permitted sender) X-PHP-List-Original-Sender: david.proweb@gmail.com X-Host-Fingerprint: 209.85.223.180 mail-io0-f180.google.com Received: from [209.85.223.180] ([209.85.223.180:41263] helo=mail-io0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/2B-55607-0385D3B5 for ; Wed, 04 Jul 2018 19:28:48 -0400 Received: by mail-io0-f180.google.com with SMTP id q9-v6so6065867ioj.8 for ; Wed, 04 Jul 2018 16:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=aDA1WurcZ+pIvsq41c5hYO7Ub18ybSevqCiIPGGSQtw=; b=MV0u/gOjp3DpYQeXvCXZRqBVKpIYNA9GmXXMZt0DtFd4M0uN8naDrdudET/eeZDHgV ptDHUmzlUHbA7qBBZg0MRaTVNGLSaJLG0NYDgcuzNAOKGI/UeBvuZRlaScIsRDBJ4jl4 HcUwoadf1Hm04J/HFazGrGIlPE3TOABDeVGLB04EVy0QUgjO8ox4Oh8mQZGzwpgDZikp yMJrebauZFnALMKP0AWWCoHM3C63OZ3K3fE1iPNKnqpQnYV0FBL1wEa7MbwGbVXorgOM +v1FcbYT9+LvQMWrfRdISQoVQco991DnDSyfKATgD2V/hk3vdIQeBIftRDSvhrEiKKfi 2rAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=aDA1WurcZ+pIvsq41c5hYO7Ub18ybSevqCiIPGGSQtw=; b=gXHiKim9ECSOnrNFW6SJhWD9SoBA58IPC686mGr+dpOBKHLPYXgmKtnjPxnl1dB10L rXEs7sVyhjfC7NW1MVAUFi8PS4+vDRDOjUr4SzQpAePs5uSjHzpaE4jEki4ovRSRxceG /7ZovlO+BL647ZlxumKtMfsDxKXnxfgJxiEIpNuuShXZGckMJKLm7FMRq9kKKMgO98c2 clZtvI/0/YyryaJBMKvf1PmZI4InUEONL825FMhRv5bkgbo1RciG0D6BPNItuVmk4pdQ yss06FbnSXIpj1NkrX7J/yaKeNmEIvuNaCy+Q11y1BuFnMIdwpIwg8eYZVuxpKPN37UI plHg== X-Gm-Message-State: APt69E2aoGRapqJ7RM4FkbaD6EWd8wEAC7cX9PbMrrJKSl+JMceZXeJD ZEqNUdYUXOKHZXJUwj5Y8goF87qKedGHoBub+OM= X-Google-Smtp-Source: AAOMgpfhw8Q0x84YyqS2Td2qujkNo30nqVT0btOcB6arB+UAFA6MJHTMYMRIqG3Ejqj8N9NaswdZT6kkx7kRXxfXFkY= X-Received: by 2002:a6b:6503:: with SMTP id z3-v6mr3074574iob.129.1530746925767; Wed, 04 Jul 2018 16:28:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 4 Jul 2018 20:28:33 -0300 Message-ID: To: Nikita Popov , PHP Internals Content-Type: multipart/alternative; boundary="000000000000c061f8057034cae1" Subject: Re: [PHP-DEV] json_encode() x-notation From: david.proweb@gmail.com (David Rodrigues) --000000000000c061f8057034cae1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Em qua, 4 de jul de 2018 19:01, Nikita Popov escreveu: > On Fri, Jun 29, 2018 at 8:51 PM, David Rodrigues > wrote: > >> =E2=80=8BHello. I saw that JS supports the x-notation (\x40) and u-notat= ion >> (\u0040), but PHP only supports u-notation. There some reason for that? >> >> JSON.parse('"\x40"'); // =3D> @ >> JSON.parse('"\u0040"'); // =3D> @ >> > > No it doesn't. JSON.parse() will correctly reject \x escapes because they > aren't valid JSON. You are using a normal JS string (which has nothing to > do with JSON and supports \x), which will unescape \x before JSON.parse() > ever sees it. If you write JSON.parse('"\\x40"') or similar, you will get > an error. > Oh! You are right. I just forgot to test this case. :D Topic is closed if no one have no more to say, so. > Nikita > --000000000000c061f8057034cae1--