Skip to content
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

Routing issue with UTF-8 #187

Open
Stevemoretz opened this issue Jun 25, 2021 · 0 comments
Open

Routing issue with UTF-8 #187

Stevemoretz opened this issue Jun 25, 2021 · 0 comments

Comments

@Stevemoretz
Copy link

Hi thanks again for this wonderful library I have a problem.I'd really appreciate if you help me out.

My problem is similar to this :
https://laracasts.com/discuss/channels/general-discussion/laravel-5-problem-with-utf-8-in-a-json-response

The result I get from my api using routing tutorial that you provided, is :
{"post_title":"\u06a9\u0641\u0634 \u0645\u0631\u062f\u0627\u0646\u0647 \u0641\u0644\u0627\u0646","guid":"http://shop-win.test/product/import-placeholder-for-385/"....

however the post_title is escaped without me wanting it to do so.
I can fix it using :

$response = $router->dispatch($request);
echo json_encode(json_decode($response->getContent(),true),JSON_UNESCAPED_UNICODE);

But it's not a very good idea I guess.
What is the alternative way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant