Skip to content

Commit

Permalink
Fix unicode problems in JSON encoding, fixes #4.
Browse files Browse the repository at this point in the history
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 ¯\_(ツ)_/¯
  • Loading branch information
maknz committed Nov 19, 2014
1 parent cb4acd2 commit bdd2708
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Maknz/Slack/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function clearAttachments()
*/
public function send($message)
{
$payload = json_encode($this->preparePayload($message));
$payload = json_encode($this->preparePayload($message), JSON_UNESCAPED_UNICODE);

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

0 comments on commit bdd2708

Please sign in to comment.