[php-src] Issue #12875: JSON_UNESCAPED_UNICODE option in json_encode does not unescape some control characters
| From: | fereron | Date: | Tue, 05 Dec 2023 13:06:18 +0000 |
| Subject: | [php-src] Issue #12875: JSON_UNESCAPED_UNICODE option in json_encode does not unescape some control characters | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245988@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12875
Author: fereron
### Description
The following code:
```php
<?php
var_dump(json_encode("\x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x10 \x11 \x12 \x13
\x14 \x15 \x16 \x17 \x18 \x19", JSON_UNESCAPED_UNICODE));
```
Resulted in this output:
```
string(133) ""\u0000 \u0001 \u0002 \u0003 \u0004 \u0005 \u0006 \u0007 \b \t \u0010 \u0011
\u0012 \u0013 \u0014 \u0015 \u0016 \u0017 \u0018 \u0019""
```
But I don't expect to see Unicode escape sequences
### PHP Version
PHP 8.3.0
### Operating System
_No response_