Everybody is good, I did a load in PHP nusoap webservice, then use pb12 to call, now also can call is successful, but the question is:
1, PHP returns English no problem, but the return to Chinese is stil
2, pb is passed to the PHP is garbled,
I have tried to use
Iconv (" GB2312 ", "utf-8", $n_title); And iconv (" GBK ", "utf-8", $n_title);
Iconv (" utf-8 ", "GB2312," $n_title); And iconv (" utf-8 ", "GBK", $n_title);
No, my PHP page format is:
CodePudding user response:
This is can go, don't know what you receive is what the type of the string or a blob,
If it is a blob directly in String (blob, encoding} {) encoding specified as EncodingUTF8! ,
If it is a string, use a Blob (text, encoding} {) encoding specified as EncodingUTF8! Now turned into a blob, then use the String (blob, encoding} {) encoding specified as EncodingUTF8! Into a string.
Originally I have parsing HTML, gibberish did
CodePudding user response:
reference 1st floor zlf19810306 response: this can turn, don't know what you receive is what the type of the string or a blob, If it is a blob directly in String (blob, encoding} {) encoding specified as EncodingUTF8! , If it is a string, use a Blob (text, encoding} {) encoding specified as EncodingUTF8! Now turned into a blob, then use the String (blob, encoding} {) encoding specified as EncodingUTF8! Into a string. Originally I parse HTML, there are stil did If this is the case, PHP returns ls_string="who am I", then the pb Blb=Blob (ls_string EncodingANSI!) Ls=String (Blb, EncodingANSI! ) Ls in the pb is to recognize the Chinese characters? CodePudding user response:
Encoding}, {, must be you received data coding type, if you receive a EncodingUTF8! And you use EncodingANSI! , the result is to continue is garbled CodePudding user response:
reference zlf19810306 reply: 3/f {, encoding} must be you received data coding type, if you receive a EncodingUTF8! And you use EncodingANSI! As a result, continue to be garbled Hee hee, still can't understand, such as variables in the pb is String ls_old, ls_new Ls_old="pb to Chinese characters display the normal" //to make Php is receiving time in utf8, want to undertake the following in the pb? Blb=Blob (ls_old EncodingUTF8!) Ls_new=String (Blb, EncodingUTF8! ) And then ls_new is utf8 character set? Directly to the PHP line?? , the feeling is not right CodePudding user response:
1, PHP returns English no problem, but the return to Chinese is stil 2, pb is passed to the PHP is stil These two problems separately said, 1, PHP returns English no problem, but the return to Chinese is garbled, This means you received data is garbled, do you want to know what you received data is encoded, this assumption is UTF8! , If you are using a blob received data, then the String (Blb, EncodingUTF8! ) can turn, If you are using the string receiving the data, then the Blob (ls_old EncodingUTF8!) This turns into a blob is UTF8 blob, and then use the String (Blb, EncodingUTF8! ), here called encoding} {, must be consistent, 2, pb is passed to the PHP is garbled, It is best to transfer binary data here, and don't pass a string, assuming ls_string is you want to transfer data To use a Blob (ls_string EncodingUTF8!) Into a blob, then pass CodePudding user response:
Because pb12 is a unicode string, there is no other coding, and blob is a binary data, can be EncodingANSI! EncodingUTF8! EncodingUTF16LE! EncodingUTF16BE! These four kind of encoding binary values CodePudding user response:
On the same problem, but I am do WS for PHP programmers call with PB, PHP environment is also nusoap components, no matter how I in PB transcoding, said a PHP programmer feedback comes with Chinese garbled, can only be set in English CodePudding user response:
I am using the first method, PHP utf8 string, Pb accept string, code, the following 1, 2, 3, CodePudding user response:
Oneself knot a post bar, tested, the problem is that good, but there are still doubts, Solution is that, in the configuration of the soap and joined the code below: $soap - & gt; Soap_defencoding="utf-8"; $soap - & gt; Decode_utf8=false; $soap - & gt; Xml_encoding="utf-8"; Sent unified as utf8 format, then PHP pb accept to Chinese characters, no in pb processing again, but I don't understand, it isn't that the outgoing character set defined as utf8,? Don't to pb when automatic processing?????? Detailed code below //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- PHP<? PHP Require_once (" nusoap/lib/nusoap PHP "); Include (' function. PHP); $namespace="www.baidu.com"; $server=new soap_server (); $server - & gt; Soap_defencoding="utf-8"; $server - & gt; Decode_utf8=false; $server - & gt; Xml_encoding="utf-8"; $server - & gt; ConfigureWSDL (" HelloExample ", $namespace); $server - & gt; The register (the 'send', Array (" platform "=& gt;" XSD: string), "Array (" return "=& gt;" XSD: string), "$namespace); The function the send ($platform) { $res="I am afraid of a"; $res=auto_charset ($res, 'GBK', 'utf-8');//depending on what the PHP file format, if is utf8 format, do not need this function Return $res; } $POST_DATA=https://bbs.csdn.net/topics/isset ($GLOBALS [' HTTP_RAW_POST_DATA ']) ? $GLOBALS [' HTTP_RAW_POST_DATA] : "'; //pass our the posted data (or nothing) to the soap service $server - & gt; Service ($POST_DATA); The exit (); ?>