Indicates if a given slug for a character set represents the UTF-8 text encoding.
Description
A charset is considered to represent UTF-8 if it is a case-insensitive match of "UTF-8" with or without the hyphen. Example: true === _is_utf8_charset( 'UTF-8' );
true === _is_utf8_charset( 'utf8' );
false === _is_utf8_charset( 'latin1' );
false === _is_utf8_charset( 'UTF 8' );
// Only strings match.
false === _is_utf8_charset( [ 'charset' => 'utf-8' ] ); is_utf8_charset should be used outside of this file.
Parameters
$charset_slugstring
Slug representing a text character encoding, or "charset". E.g. "UTF-8", "Windows-1252", "ISO-8859-1", "SJIS".
Return
bool
Whether the slug represents the UTF-8 encoding.
Used by · 3
_mb_strlen()Internal compat function to mimic mb_strlen().
_mb_substr()Internal compat function to mimic mb_substr().
is_utf8_charset()Indicates if a given slug for a character set represents the UTF-8 text encoding. If not provided, examines the current blog's charset.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/compat.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.