private function _decode_entities($text)
{
$text = html_entity_decode($text, ENT_QUOTES, 'ISO-8859-1');
#NOTE: UTF-8 does not work!
$text = preg_replace('/&#(\\d+);/m', 'chr(\\1)', $text);
#decimal notation
$text = preg_replace('/&#x([a-f0-9]+);/mi', 'chr(0x\\1)', $text);
#hex notation
return $text;
}