wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



_canonical_charset › WordPress Function

Depuis3.6.0
Dépréciéen/a
_canonical_charset ( $charset )
Accès:
  • private
Paramètres:
  • (string) $charset A charset name.
    Requis: Oui
Voir:
Retourne:
  • (string) The canonical form of the charset.
Défini(e) dans:
Codex:

Retrieves a canonical form of the provided charset appropriate for passing to PHP functions such as htmlspecialchars() and charset HTML attributes.



Source

function _canonical_charset( $charset ) {
	if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset ) ) {

		return 'UTF-8';
	}

	if ( 'iso-8859-1' === strtolower( $charset ) || 'iso8859-1' === strtolower( $charset ) ) {

		return 'ISO-8859-1';
	}

	return $charset;
}