Working with Japanese filenames in PHP 5.3 and Windows Vista?

前端 未结 5 1042
名媛妹妹
名媛妹妹 2020-12-06 09:00

I\'m currently trying to write a simple script that looks in a folder, and returns a list of all the file names in an RSS feed. However I\'ve hit a major wall... Whenever I

5条回答
  •  天命终不由人
    2020-12-06 09:37

    This displays Japanese filenames correctly on a Windows server

    if ($handle = opendir($this->dir)) {
        while (false !== ($file = readdir($handle))){
            $name = mb_convert_encoding($file, "UTF-8", "SJIS-win" );
            echo "$name
    "; } closedir($handle); }

提交回复
热议问题