php-src/ext/json/tests/bug41067.phpt
Antony Dovgal 1607e9fa79 MFB fix for #41034
add missing tests
2007-04-23 10:48:13 +00:00

24 lines
489 B
PHP

--TEST--
Bug #41067 (json_encode() problem with UTF-16 input)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$single_barline = "\360\235\204\200";
$array = array($single_barline);
var_dump(bin2hex((binary)$single_barline));
$json = json_encode($array);
$json_decoded = json_decode($json, true);
var_dump(bin2hex((binary)$json_decoded[0]));
?>
--EXPECT--
string(8) "f09d8480"
string(8) "f09d8480"
--UEXPECT--
unicode(8) "f09d8480"
unicode(8) "f09d8480"