wpseek.com
A WordPress-centric search engine for devs and theme authors
_canonical_charset is private and should not be used in themes or plugins directly.
_canonical_charset › WordPress Function
Since3.6.0
Deprecatedn/a
› _canonical_charset ( $charset )
Access: |
|
Parameters: |
|
See: | |
Returns: |
|
Defined at: |
|
Codex: |
Retrieves a canonical form of the provided charset appropriate for passing to PHP functions such as htmlspecialchars() and charset HTML attributes.
Related Functions: rel_canonical, wp_get_canonical_url, wp_specialchars, wp_admin_canonical_url, _wp_specialchars
Source
function _canonical_charset( $charset ) { if ( is_utf8_charset( $charset ) ) { return 'UTF-8'; } /* * Normalize the ISO-8859-1 family of languages. * * This is not required for htmlspecialchars(), as it properly recognizes all of * the input character sets that here are transformed into "ISO-8859-1". * * @todo Should this entire check be removed since it's not required for the stated purpose? * @todo Should WordPress transform other potential charset equivalents, such as "latin1"? */ if ( ( 0 === strcasecmp( 'iso-8859-1', $charset ) ) || ( 0 === strcasecmp( 'iso8859-1', $charset ) ) ) { return 'ISO-8859-1'; } return $charset; }