marcj / php-rest-service

Php-Rest-Service is a very simple and fast PHP class for server-side RESTful JSON APIs.
MIT License
216 stars 74 forks source link

JSON output: please add right encoding #38

Open gubi opened 6 years ago

gubi commented 6 years ago

I encountered a problem with the json output: accented vowels and apostrophes were parsed as "\u00e0" or "\u2019". I solved simply by adding the native php json_encode() suffix JSON_FORCE_OBJECT|JSON_UNESCAPED_UNICODE in

https://github.com/marcj/php-rest-service/blob/3263cd29881574077ec8f7f849713f4a59e4a37f/RestService/Client.php#L251

like this:

if (!is_string($json)) $json = json_encode($json, JSON_FORCE_OBJECT|JSON_UNESCAPED_UNICODE);

Please integrate it in your code ;)

marcj commented 5 years ago

Please provide a pull-request, so I can merge.