Why is this the extended ascii character (â, é, etc) getting replaced with <?> characters?

后端 未结 8 786
自闭症患者
自闭症患者 2021-01-06 12:00

Why is this the extended ascii character (â, é, etc) getting replaced with characters?

I attached a pic... but I am using PHP to pull the data from MySQL,

8条回答
  •  粉色の甜心
    2021-01-06 12:18

    I changed all my tables over to UTF-8 and reinserted all the data (waste of time) as it never helped. It was latin1 prior.

    If your original data was latin1, then inserting it into a UTF-8 database won't convert it to UTF-8, AFAIK, it will insert the same data but now believe it's UTF-8, thus breaking.

    If you've got a SQL dump, I'd suggest running it through a tool to convert to UTF-8. Notepad++ does this pretty well - simply open the file, check that the accented characters are displaying correctly, then find "convert to UTF-8" in the menu.

提交回复
热议问题