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