Home  >  Article  >  Backend Development  >  php调用webservice接口,乱码及报错的有关问题

php调用webservice接口,乱码及报错的有关问题

WBOY
WBOYOriginal
2016-06-13 12:36:571113browse

php调用webservice接口,乱码及报错的问题

$client = new SoapClient('http://www.webxml.com.cn/WebServices/TraditionalSimplifiedWebService.asmx?wsdl');
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;
$obj = $client->toTraditionalChinese(array('sText'=>'个'));
print_r($obj);
?>
这个是我写的一个调用网上公开的简繁转换的webservice的代码,我已经指定了soap_defencoding为UTF-8,decode_utf8设置成false,但是执行了之后提示【Encoding: string '\xb8...' is not a valid utf-8 string 】

请大家帮忙看看这个该怎么处理

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn