bug41067.phpt 523 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #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);
  9. print bin2hex($single_barline) . "\n";
  10. // print $single_barline . "\n\n";
  11. $json = json_encode($array);
  12. print $json . "\n\n";
  13. $json_decoded = json_decode($json, true);
  14. // print $json_decoded[0] . "\n";
  15. print bin2hex($json_decoded[0]) . "\n";
  16. print "END\n";
  17. ?>
  18. --EXPECT--
  19. f09d8480
  20. ["\ud834\udd00"]
  21. f09d8480
  22. END