如何解决laravel 5.2中的utf8_encode问题?

时间:2018-03-28 10:46:41

标签: php angularjs laravel-5 utf-8

如果我的应用程序,我使用雄辩模型获取所有帖子数据并将其响应作为json发送到另一个应用程序,如果帖子内容包含任何特殊字符,则显示以下错误,enter image description here

经过长时间的搜索后,我用

解决了这个问题
$post->content = utf8_encode($post->content);


现在问题是在将此json发送到另一个应用程序之后,其中显示在浏览器中的数据特殊字符未解码它们显示为
enter image description here


enter image description here

我们如何在浏览器中解决这个问题,目前我正在使用angularjs作为前端。

0 个答案:

没有答案