Skip to content

Commit 92fa825

Browse files
committed
dont escape unicode characters
1 parent 8c8739b commit 92fa825

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/BaseClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function request(string $path, string $method, array $options = []) {
6868
$ch = curl_init($url);
6969

7070
if (HttpMethod::POST === $method) {
71-
$params = stripslashes(json_encode($options));
71+
$params = stripslashes(json_encode($options, JSON_UNESCAPED_UNICODE));
7272

7373
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
7474
curl_setopt($ch, CURLOPT_POST, true);

tests/Client/SmsTest.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88

99
class SmsTest extends BaseTest {
1010
public function testSms(): void {
11-
$res = $this->client->sms->dispatch($this->params);
11+
$params = clone $this->params;
12+
$params->setText('Müller');
13+
$res = $this->client->sms->dispatch($params);
1214

1315
$msg = $res->getMessages()[0];
14-
$this->assertEquals($this->params->getText(), $msg->getText());
15-
$this->assertEquals(str_replace('+', '', $this->params->getTo()[0]), $msg->getRecipient());
16+
$this->assertEquals($params->getText(), $msg->getText());
17+
$this->assertEquals(str_replace('+', '', $params->getTo()[0]), $msg->getRecipient());
1618
}
1719

1820
public function testSmsFiles(): void {

0 commit comments

Comments
 (0)