Laravel 5 charset not working correctly on the views. But it working well when I dump it from controller

后端 未结 4 1511
囚心锁ツ
囚心锁ツ 2020-12-11 04:18

I\'m facing a charset problem here. I\'m developing an app that uses a sql server database. The database was not created for this app, it exists before it and works very wel

4条回答
  •  轮回少年
    2020-12-11 04:41

    Since successful and error response do not behave consistently, the difference may be in the HTTP headers. If that's the case, what happens is that Sqlserver and your browser use the same encoding, likely some Windows default, like cp1252, while Laravel is configured to respond with a different charset than the one used in the database.

    Check the HTTP header content-type both when you invoke the view and when you die() - if that is your issue configure Laravel to send some header that agrees with your templates and your database encoding (or of course! transcode explicitely when needed)

提交回复
热议问题