设置内部编码。
原型
wp_set_internal_encoding()
描述
在大多数情况下,默认的内部编码是latin1,这是没有用的,因为我们想要使用utb-8字符串的mb_函数。
源文件
路径:wp-includes/load.php
<?php
...
function wp_set_internal_encoding() {
if ( function_exists( 'mb_internal_encoding' ) ) {
$charset = get_option( 'blog_charset' );
if ( ! $charset || ! @mb_internal_encoding( $charset ) )
mb_internal_encoding( 'UTF-8' );
}
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_set_internal_encoding/