wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_canonical_charset › WordPress Function

Seit3.6.0
Veraltetn/v
_canonical_charset ( $charset )
Zugriff:
  • private
Parameter:
  • (string) $charset A charset name.
    Erforderlich: Ja
Siehe:
Gibt zurück:
  • (string) The canonical form of the charset.
Definiert in:
Codex:

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



Quellcode

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