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