bug66431_0.phpt 696 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Bug #66431 Special Character via COM Interface (CP_UTF8), Scripting.FileSystemObject
  3. --EXTENSIONS--
  4. com_dotnet
  5. --FILE--
  6. <?php
  7. $text= "Xin chào cộng đồng PHP";
  8. $fpath = str_replace("/", "\\", __DIR__ . "/bug66431.txt");
  9. $fso = new COM("Scripting.FileSystemObject");
  10. $fh = $fso->OpenTextFile($fpath, 2, true);
  11. $fh->Write($text);
  12. $fh->Close();
  13. $check_text = file_get_contents($fpath);
  14. $result = ($check_text == $text);
  15. var_dump($result);
  16. if (!$result) {
  17. echo "Expected: '$check_text'\n";
  18. echo "Have: '$text'\n";
  19. }
  20. ?>
  21. --CLEAN--
  22. <?php
  23. $fpath = str_replace("/", "\\", __DIR__ . "/bug66431.txt");
  24. if (file_exists($fpath)) {
  25. unlink($fpath);
  26. }
  27. ?>
  28. --EXPECT--
  29. bool(true)