I'm searching a method to convert a torrent encoding (from UTF-8-BOM to WINDOWS-1252) before download because if I download it simply with readfile() the torrent is not valid bencoding, so I need to convert it to WINDOWS-1252 or CP1252.
Click Download on my page, and download the torrent file encoded in WINDOWS-1252.
This is my script:
header("Content-Disposition: attachment; filename=\"$tname.torrent\"");header("Content-Type: application/octet-stream");header("Content-Length: " . filesize($fn));$content = iconv("UTF-8", "WINDOWS-1252", readfile($fn));print($content);
Acually, this script is not working because when I download the file, it's empty. What to do?
iconv()call fails... - arkascha