Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 36fa17a5fa
Fetching contributors…

Cannot retrieve contributors at this time

file 20 lines (18 sloc) 0.985 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
--TEST--
bug #53946 (json_encode() with JSON_UNESCAPED_UNICODE)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_encode("latin 1234 -/ russian мама мыла раму specialchars \x02 \x08 \n U+1D11E >𝄞<"));
var_dump(json_encode("latin 1234 -/ russian мама мыла раму specialchars \x02 \x08 \n U+1D11E >𝄞<", JSON_UNESCAPED_UNICODE));
var_dump(json_encode("ab\xE0"));
var_dump(json_encode("ab\xE0", JSON_UNESCAPED_UNICODE));
?>
--EXPECTF--
string(156) ""latin 1234 -\/ russian \u043c\u0430\u043c\u0430 \u043c\u044b\u043b\u0430 \u0440\u0430\u043c\u0443 specialchars \u0002 \b \n U+1D11E >\ud834\udd1e<""
string(100) ""latin 1234 -\/ russian мама мыла раму specialchars \u0002 \b \n U+1D11E >𝄞<""

Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
bool(false)

Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
bool(false)
Something went wrong with that request. Please try again.