PHP Utf8 Decoding Issue

前端 未结 4 1724
忘掉有多难
忘掉有多难 2020-12-18 02:58

I have the following address line: Praha 5, Staré Město,

I need to use utf8_decode() function on this string before I can write it to a PDF file (us

4条回答
  •  不思量自难忘°
    2020-12-18 03:51

    utf8_decode converts the string from a UTF-8 encoding to ISO-8859-1, a.k.a. "Latin-1".
    The Latin-1 encoding cannot represent the letter "ě". It's that simple.
    "Decode" is a total misnomer, it does the same as iconv('UTF-8', 'ISO-8859-1', $string).

    See What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text.

提交回复
热议问题