THE PROBLEM: I need a XML file \"full encoded\" by UTF8; that is, with no entity representing symbols, all symbols enconded by UTF8, except the only 3 ones that are
Try this function:
function xmlsafe($s,$intoQuotes=1) {
if ($intoQuotes)
return str_replace(array('&','>','<','"'), array('&','>','<','"'), $s);
else
return str_replace(array('&','>','<'), array('&','>','<'), html_entity_decode($s));
}
example usage:
echo ' ';
also: https://stackoverflow.com/a/9446666/2312709
this code used in production seem that no problems happened with UTF-8