Do I need to set ini_set( 'default_charset', 'UTF-8' );?

后端 未结 4 1363
暗喜
暗喜 2020-12-30 09:53

My framework for each pages does the follow:

ini_set(\'mbstring.internal_encoding\',\'UTF-8\');
ini_set(\'mbstring.func_overload\',7);
header(\'Content-Type:         


        
4条回答
  •  庸人自扰
    2020-12-30 10:41

    When it comes to the http-header, you're OK as the other answers explain.

    But: There are some functions that are default charset aware

    From the description of FILTER_SANITIZE_FULL_SPECIAL_CHARS:

    Like htmlspecialchars, this filter is aware of the default_charset and if a sequence of bytes is detected that makes up an invalid character in the current character set then the entire string is rejected resulting in a 0-length string.

提交回复
热议问题