Support the ongoing development of Laravel.io →
posted 10 years ago
Views
Last updated 2 years ago.
0

Ok, after some fishing around figured this out. Response::json accepts 4 parameters:

public static function json($data = array(), $status = 200, array $headers = array(), $options = 0)

So I changed my code to pass in the JSON_UNESCAPED_UNICODE option:

return Response::json(["partagés"],200,[], JSON_UNESCAPED_UNICODE);

Is there a better/more elegant way to do this? Seems a bit clunky...

Last updated 2 years ago.
0

Why are you afraid of escaped json? It will return to normal when you parse the string.

Last updated 2 years ago.
0

ah... I've been testing with a plain rest client that doesn't do any parsing... thought it was going to be annoying to deal with. just tested with something closer to the clients that will be consuming my data and all's good. Thanks for the response. no longer afraid ;)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.