简体   繁体   中英

contents from fopen in typo3 and special characters

I have recently upgraded my typo3-installation. The new version is running utf8 only. My old installation used iso8859-1. It is not possible to revert back to my old charset unfortunately...

I have a script which loads in data from another server via :

$handle = fopen("www.my-url.com/myloader.php", "r");
 if ($handle) {
    $contents = '';
    while (!feof($handle)) {
        $contents .= fread($handle, 8192);
        }
    fclose($handle);
echo $contents;

my problem now is that danish-special-characters are not translated properly. I have tried both utf8_encode & decode on $contents but neither works. I cannot change the script on the other server as it is provider for many other sites which still has the old typo3-install running.

在myloader.php中获取一个GET参数,该参数指定应对结果进行编码的字符集。默认为ISO 8859-1,并根据需要使用iconv转换为UTF-8,反之亦然。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM