New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't send multibyte string. #4

Closed
serima opened this Issue Nov 19, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@serima
Copy link

serima commented Nov 19, 2014

I try to send Japanese string encoded UTF-8.
json_encode returns bool(false).

Could you please add json_encode option JSON_UNESCAPED_UNICODE as follows.

https://github.com/maknz/slack/blob/master/src/Maknz/Slack/Client.php#L316

$payload = json_encode($this->preparePayload($message), JSON_UNESCAPED_UNICODE);
@maknz

This comment has been minimized.

Copy link
Owner

maknz commented Nov 19, 2014

Hi @serima. Thanks for the report. Can you provide the string you were trying to send, so I can test?

@serima

This comment has been minimized.

Copy link

serima commented Nov 19, 2014

Hi @maknz!
Thank you for your quick reply.

Yes, of course. please try this message.

日本語
@maknz

This comment has been minimized.

Copy link
Owner

maknz commented Nov 19, 2014

Great thanks, I'll look at this now. It's weird that json_encode outright fails, it should have converted those characters to \u<something> (escaped unicode). I'll have a play with your solution and get a patch out.

@serima

This comment has been minimized.

Copy link

serima commented Nov 19, 2014

Thank you!

@maknz maknz closed this in bdd2708 Nov 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment