I have a database table holding products which is set to latin1 - default collation which can't be changed
I've written a script which uses DOMDocument to add a new li to an existing ul in the product description
The code if anyone is interested is
$current_description = '
<ul>
<li>Here is some broken encoding – </li>
</ul>
';
$dom = new DOMDocument;
$dom->loadHTML($current_description);
$ul = $dom->getElementsByTagName('ul')->item(0);
$li = $dom->createElement('li', 'Content');
$ul->appendChild($li);
echo $dom->saveHTML($dom->documentElement);
I'm facing problems with encoding on the output, examples below
  becomes Â
– becomes –
I have searched for a solution but can't find one that works
I've tried mb_convert_encoding with varying parameters without any luck
E.g.
$current_description = mb_convert_encoding($current_description, 'utf-8', mb_detect_encoding($current_description));
Anyone have any ideas?
Thanks in advance