When processing certain special characters in the input string, the resulting output may differ from the original input. For instance, if the input string contains the character sequence –, it may be converted to – in the output. Unfortunately, there's no way to preserve the exact output as the input when such characters are involved.
To illustrate the problem, consider the following code snippet:
<?php
require_once 'simplehtmldom/simple_html_dom.php';
$input = '<p>Hello – World</p>';
$dom = str_get_html($input, false, false, 'UTF-8', false);
$output = $dom->save();
echo $input; // Prints: <p>Hello – World</p>
echo $output; // Prints: <p>Hello – World</p>
I've also submitted a patch to address this issue here: https://sourceforge.net/p/simplehtmldom/feature-requests/68/