How to get file content with a proper utf-8 encoding using file_get_contents?
问题 I need to get content of the remote file in utf-8 encoding. The file in in utf-8. When I display that file on screen, it has proper encoding: http://www.parfumeriafox.sk/source_file.html (notice the ň and č characters, for example, these are alright). When I run this code: <?php $url = 'http://parfumeriafox.sk/source_file.html'; $csv = file_get_contents_utf8($url); header('Content-type: text/html; charset=utf-8'); print $csv; function file_get_contents_utf8($fn) { $content = file_get_contents