Encoding issue: £ pound symbol appearing as <?> symbol

前端 未结 2 1595
感情败类
感情败类 2021-01-22 02:02

My database field is set to utf8_general_ci and my websites encoding is utf8.

The £ symbol is coming up as a black diamond with a question mark through the center.

2条回答
  •  后悔当初
    2021-01-22 02:55

    Before communicating with your database, you need to send the query :

    SET NAMES 'UTF-8'
    

    It tells the database to use utf8 encoding for all queries on this connection.

提交回复
热议问题