|
@@ -61,7 +61,7 @@ class TestRBridge extends TestCase
|
|
public function testTCPAdd()
|
|
public function testTCPAdd()
|
|
{
|
|
{
|
|
$params = $this->getParams();
|
|
$params = $this->getParams();
|
|
- $resp = $this->send('121.89.223.81', json_encode($params));
|
|
|
|
|
|
+ $resp = $this->send('121.89.223.81', json_encode($params,JSON_UNESCAPED_UNICODE));
|
|
}
|
|
}
|
|
|
|
|
|
public function send($host, $body)
|
|
public function send($host, $body)
|
|
@@ -86,6 +86,19 @@ class TestRBridge extends TestCase
|
|
$resp = $this->send('121.89.223.81', $body);
|
|
$resp = $this->send('121.89.223.81', $body);
|
|
$body = mb_convert_encoding($body, 'UTF-8', 'GBK');
|
|
$body = mb_convert_encoding($body, 'UTF-8', 'GBK');
|
|
|
|
|
|
|
|
+ $ret = '{"action":"CZ","chargeId":547835,"retCode":3,"retDetail":"\u4f59\u989d\u4e0d\u8db3","retRsn":"20201230182251579","sign":"a4a276d8149de299f6357dab508d76c0"}';
|
|
|
|
+ $encode = mb_detect_encoding($ret);
|
|
|
|
+ $ret = mb_convert_encoding($ret, 'GBK','UTF-8');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function testJson()
|
|
|
|
+ {
|
|
|
|
+ $body = $this->getParams();
|
|
|
|
+ $data = json_encode($body,JSON_UNESCAPED_UNICODE);
|
|
|
|
+ $encode = mb_detect_encoding($data);
|
|
|
|
+ $ret = mb_convert_encoding($data, 'GBK',$encode);
|
|
|
|
+ $ret = mb_convert_encoding($data, $encode,'GBK');
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
public function testSurAdd()
|
|
public function testSurAdd()
|