Skip to content

Commit bdd2708

Browse files
committed
Fix unicode problems in JSON encoding, fixes #4.
Not sure why json_encode() outright broke with a string like 日本語, it should have just returned escaped unicode like \u<something>. But telling json_encode() to not escape unicode and leave as-is seems to fix the problem so ¯\_(ツ)_/¯
1 parent cb4acd2 commit bdd2708

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Maknz/Slack/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public function clearAttachments()
313313
*/
314314
public function send($message)
315315
{
316-
$payload = json_encode($this->preparePayload($message));
316+
$payload = json_encode($this->preparePayload($message), JSON_UNESCAPED_UNICODE);
317317

318318
$this->guzzle->post($this->endpoint, ['body' => $payload]);
319319
}

0 commit comments

Comments
 (0)