using ...
$data = htmlentities($data, ENT_COMPAT, mb_detect_encoding($data));
i get the error ....
Warning: htmlentities(): charset ASCII' not supported, assuming iso-8859-1 in ...
Warning: htmlentities(): charsetASCII' not supported, assuming iso-8859-1 in ...
Warning: htmlentities(): charset `ASCII' not supported, assuming iso-8859-1 in ...
However, if i use the 'ASCII' parameter in mb_convert_encoding function ...
$data = mb_convert_encoding($data, "UTF-8", "ASCII");
the data is not correctly converted....