xref: /PHP-7.2/ext/json/tests/bug41067.phpt (revision 8b245e5a)
1--TEST--
2Bug #41067 (json_encode() problem with UTF-16 input)
3--SKIPIF--
4<?php if (!extension_loaded("json")) print "skip"; ?>
5--FILE--
6<?php
7$single_barline = "\360\235\204\200";
8$array = array($single_barline);
9print bin2hex($single_barline) . "\n";
10// print $single_barline . "\n\n";
11$json = json_encode($array);
12print $json . "\n\n";
13$json_decoded = json_decode($json, true);
14// print $json_decoded[0] . "\n";
15print bin2hex($json_decoded[0]) . "\n";
16print "END\n";
17?>
18--EXPECT--
19f09d8480
20["\ud834\udd00"]
21
22f09d8480
23END
24