Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
I just added this line $tmp = str_replace("utf-16", "utf-8", $data); under line $tmp = str_replace("^M", "", $data);.
$tmp = str_replace("utf-16", "utf-8", $data);
$tmp = str_replace("^M", "", $data);
It's rather crude, but it works :))
edit: This could work too: $tmp = str_replace("utf-16\"?>", "utf-16\"?>\n", $data);
$tmp = str_replace("utf-16\"?>", "utf-16\"?>\n", $data);