wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



_canonical_charset › WordPress Function

Da3.6.0
Deprecaton/a
_canonical_charset ( $charset )
Accedi:
  • private
Parametri:
  • (string) $charset A charset name.
    Richiesto:
Vedi:
Ritorna:
  • (string) The canonical form of the charset.
Definito a:
Codex:

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



Sorgenti

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;
}