setting utf8 with mysql through php

后端 未结 2 889
忘了有多久
忘了有多久 2020-12-21 23:12

I have the following very simple code, which retrieves utf8 formatetd data, such as containing umlauts from a mysql database, which may or may not be set as utf8. If I use e

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-21 23:45

    1. Make sure your data is already UTF-8 encoded in your database
    2. configure database to deliver UTF-8 (eg. SET NAMES 'utf8')
    3. use the right encoding on your website (nod to stak)

    If you still have problems, please provide more data, especially what is expected and what finally delivered

提交回复
热议问题