Reply to Error when transcoding from UTF16 to UTF8 with utf8_encode

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация