bug41067.phpt 458 B

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