xref: /PHP-8.0/ext/json/tests/bug53946.phpt (revision 32a1ebbd)
1--TEST--
2bug #53946 (json_encode() with JSON_UNESCAPED_UNICODE)
3--FILE--
4<?php
5var_dump(json_encode("latin 1234 -/    russian мама мыла раму  specialchars \x02   \x08 \n   U+1D11E >��<"));
6var_dump(json_encode("latin 1234 -/    russian мама мыла раму  specialchars \x02   \x08 \n   U+1D11E >��<", JSON_UNESCAPED_UNICODE));
7var_dump(json_encode("ab\xE0"));
8var_dump(json_encode("ab\xE0", JSON_UNESCAPED_UNICODE));
9?>
10--EXPECT--
11string(156) ""latin 1234 -\/    russian \u043c\u0430\u043c\u0430 \u043c\u044b\u043b\u0430 \u0440\u0430\u043c\u0443  specialchars \u0002   \b \n   U+1D11E >\ud834\udd1e<""
12string(100) ""latin 1234 -\/    russian мама мыла раму  specialchars \u0002   \b \n   U+1D11E >��<""
13bool(false)
14bool(false)
15