On Fri, Jun 29, 2018 at 1:51 PM, David Rodrigues <david.pro...@gmail.com> wrote:
> Hello. I saw that JS supports the x-notation (\x40) and u-notation
> (\u0040), but PHP only supports u-notation. There some reason for that?
>
The TL;DR version AIUI, is that JSON strings are Unicode strings, so
any byte sequence in a JSON string must be valid UTF-8.  With \x
encoding, one could easily create byte sequences which are not valid
UTF-8.  Best practices tend to use an intermediate, binary-safe
encoding (such as base64) when needing to transfer octet streams.

-Sara

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

Reply via email to