Detect encoding and make everything UTF-8

前端 未结 24 2398
暗喜
暗喜 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:17

    Ÿ is Mojibake for ß. In your database, you may have hex

    DF if the column is "latin1",
    C39F if the column is utf8 -- OR -- it is latin1, but "double-encoded"
    C383C5B8 if double-encoded into a utf8 column
    

    You should not use any encoding/decoding functions in PHP; instead, you should set up the database and the connection to it correctly.

    If MySQL is involved, see: Trouble with utf8 characters; what I see is not what I stored

提交回复
热议问题