How to handle user input of invalid UTF-8 characters?

后端 未结 9 2021
小鲜肉
小鲜肉 2020-11-29 17:26

I\'m looking for general a strategy/advice on how to handle invalid UTF-8 input from users.

Even though my webapp uses UTF-8, somehow some users enter invalid chara

9条回答
  •  一整个雨季
    2020-11-29 18:23

    There is a multibyte extension for PHP, check it out: http://www.php.net/manual/en/book.mbstring.php

    You should try mb_check_encoding() function.

    Good luck!

提交回复
热议问题