I have a MySQL db with a table with latin1 character set. In a text field there is a '-' N-dash char.
I created a javascript function using XMLHttpRequest() to POST request to a php page that extracts and formats the content of the db; in php I use htmlentities($content, ENT_QUOTES, 'ISO-8859-15') to convert special chars.
When I "call" the php page directly there is not problem and the N-dash char prompt correctly; but when I call the php page with the javascript function and put the result into a <div> element, the N-dash char becomes a �.
Where I'm falling?
SOLVED Googlin for other problems I found the solution: adding
mysql_query("SET NAMES 'utf8'");
before sending the query to MySQL.