Different charset on different server?

后端 未结 2 506
没有蜡笔的小新
没有蜡笔的小新 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:30

    I recommend you rely on existing, highly-tested code to do this. I believe all these functions assume UTF-8 input and output 7-bit ASCII:

    • remove_accents() from Wordpress
    • Drupal's transliteration module (would require a little work to untie it from Drupal)
    • utf8_to_ascii() from the venerable PHP UTF8 project
    • friendly_url() by Jakub Vrána
    • Doctrine_Inflector::urlize()
    • slugify() looks solid

提交回复
热议问题