PHP Class Phergie_Plugin_Encoding, phergie

Inheritance: extends Phergie_Plugin_Abstract
Show file Open project: phergie/phergie

Protected Properties

Property Type Description
$entities array Lookup table for entity conversions not supported by html_entity_decode()

Public Methods

Method Description
codeToUtf8 ( integer $code ) : string Converts a given unicode to its UTF-8 equivalent.
decodeEntities ( string $string, string $charset = 'UTF-8' ) : string Decodes markup entities in a given string.
transliterate ( string $string, string $charsetFrom = 'UTF-8', string $charsetTo = 'ISO-8859-1' ) : string Transliterates characters in a given string where possible.

Method Details

codeToUtf8() public method

Converts a given unicode to its UTF-8 equivalent.
public codeToUtf8 ( integer $code ) : string
$code integer Code to convert
return string Character corresponding to code

decodeEntities() public method

Decodes markup entities in a given string.
public decodeEntities ( string $string, string $charset = 'UTF-8' ) : string
$string string String containing markup entities
$charset string Optional character set name to use in decoding entities, defaults to UTF-8
return string String with markup entities decoded

transliterate() public method

Transliterates characters in a given string where possible.
public transliterate ( string $string, string $charsetFrom = 'UTF-8', string $charsetTo = 'ISO-8859-1' ) : string
$string string String containing characters to transliterate
$charsetFrom string Optional character set of the string, defaults to UTF-8
$charsetTo string Optional character set to which the string should be converted, defaults to ISO-8859-1
return string String with characters transliterated or the original string if transliteration was not possible

Property Details

$entities protected static property

Lookup table for entity conversions not supported by html_entity_decode()
protected static array $entities
return array