UTF8 to latin1_swedish_ci

前端 未结 2 1182
再見小時候
再見小時候 2020-12-21 04:57

There are a lot of topics about latin1_swedisch_ci to utf8 conversion. But what about the other way around? I\'m dealing for quite a long time with this problem and I haven\

相关标签:
2条回答
  • 2020-12-21 05:22

    iconv() will convert strings from one encoding to the other.

    The encodings that are of interest to you are utf-8 and iso-8859-1 - the latter is equivalent with latin1.

    The "swedish", "german" etc. localizations affect issues like sorting only, the character encoding is always the same.

    PS.

    then I have to write something like $name='Bürki'.

    If you encode your source file as UTF-8, you can write Bürki directly. (You would then have to convert that string into iso-8859-1)

    0 讨论(0)
  • 2020-12-21 05:42

    I agree with Pekka, however, I would try to use the utf8_decode() function instead because it is possible that iconv is not installed...

    Iconv, however, is more powerful - it can do transliteration for an example. But for this purpose I believe utf8_decode() is enough.

    0 讨论(0)
提交回复
热议问题