mercredi 28 mars 2018

How to solve utf8_encode issue in laravel 5.2?

If my application, i am fetching all posts data using eloquent models and sending its response as json to another application, if the post content contains any special character it is showing following error,enter image description here

after a long search i solved it by using

$post->content = utf8_encode($post->content);


now the problem is after sending this json to another app where data displaying in browser special characters are not decoding they shows as
enter image description here


enter image description here

how can we solve this in browser, currently i am using angularjs as frontend.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2E1ufOY
via IFTTT

Aucun commentaire:

Enregistrer un commentaire