Detect encoding and make everything UTF-8

前端 未结 24 2754
暗喜
暗喜 2020-11-22 03:03

I\'m reading out lots of texts from various RSS feeds and inserting them into my database.

Of course, there are several different character encodings used in the fee

24条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 03:27

    A little heads up. You said that the "ß" should be displayed as "Ÿ" in your database.

    This is probably because you're using a database with Latin-1 character encoding or possibly your PHP-MySQL connection is set wrong, this is, P believes your MySQL is set to use UTF-8, so it sends data as UTF-8, but your MySQL believes PHP is sending data encoded as ISO 8859-1, so it may once again try to encode your sent data as UTF-8, causing this kind of trouble.

    Take a look at mysql_set_charset. It may help you.

提交回复
热议问题