bug28969.phpt 875 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Bug #28969 (Wrong data encoding of special characters)
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. function test() {
  8. return "¦è¥";
  9. // return utf8_encode("¦è¥");
  10. }
  11. class LocalSoapClient extends SoapClient {
  12. function __construct($wsdl, $options) {
  13. parent::__construct($wsdl, $options);
  14. $this->server = new SoapServer($wsdl, $options);
  15. $this->server->addFunction('test');
  16. }
  17. function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
  18. ob_start();
  19. $this->server->handle($request);
  20. $response = ob_get_contents();
  21. ob_end_clean();
  22. return $response;
  23. }
  24. }
  25. $x = new LocalSoapClient(NULL,array('location'=>'test://',
  26. 'uri'=>'http://testuri.org',
  27. 'encoding'=>'ISO-8859-1'));
  28. var_dump($x->test());
  29. echo "ok\n";
  30. ?>
  31. --EXPECT--
  32. string(3) "¦è¥"
  33. ok