Posted by Matthias Langbein on 01/09/07 00:14
Hi all,
when i convert a uploaded file to UTF-8 with the utf8_encode function,
the string is prefixed by the two characters
ÿþ
The file is originally encoded as UTF-16. Can anybody tell me, why
this happens?
Code:
if (isset($_FILES['Datei']) and !$_FILES['Datei']['error']) {
$buffer = file_get_Contents($_FILES['Datei']['tmp_name']);
$buffer = utf8_encode($buffer);
.....
echo $buffer;
unlink($_FILES['Datei']['tmp_name']);
}
Thanks,
Langi
[Back to original message]
|