Different charset on different server?

后端 未结 2 504
没有蜡笔的小新
没有蜡笔的小新 2020-12-21 15:51

I\'ve just tested locally my web application, everything works fine, but after uploading to server application behaves differently. I use function formatiraj_string_url to c

2条回答
  •  离开以前
    2020-12-21 16:20

    Which charset is your file written in?

    Since you have written the characters you would like to replace directly into your code, as strings, they are encoded in whatever charset the file uses. If that charset differs from what you get from the browser, your functions aren't going to work.

    The important point you need to keep in mind, is to always keep track of the charset your strings are encoded with, and convert when neccessary.

    Take a look at Kore Nordmanns FAQ about charsets in PHP for some more pointers about charsets.

提交回复
热议问题