|
@@ -45,6 +45,10 @@ class WSDBridge
|
|
|
if(!empty($body)) {
|
|
|
Log::record("req:{$body}",Log::DEBUG);
|
|
|
$response = $this->relay_request($body);
|
|
|
+
|
|
|
+ $encode = mb_detect_encoding($response, ['GB2312','GBK','UTF-8']);
|
|
|
+ $response = mb_convert_encoding($response,$encode, 'GBK');
|
|
|
+
|
|
|
socket_write($client,$response);
|
|
|
Log::record("resp:{$response}",Log::DEBUG);
|
|
|
}
|
|
@@ -106,8 +110,9 @@ class WSDBridge
|
|
|
$content .= $buf;
|
|
|
}
|
|
|
Log::record("buf={$buf}",Log::DEBUG);
|
|
|
+ $content = mb_convert_encoding($content,'GBK', 'UTF-8');
|
|
|
+ Log::record("content={$content}",Log::DEBUG);
|
|
|
|
|
|
- $content = iconv('GBK', 'UTF-8', $content);
|
|
|
if ($this->isbody($content)) {
|
|
|
return $content;
|
|
|
}
|