因此,我有一些代碼,它使用RecursiveDiectoryIterator和RecursiveIteratorIterator來定位文件來查找目錄中的所有文件。我然後檢查文件是否存在,對一些人來說並不文件...在Windows上使用國際名稱的php文件名
$fromIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir,FilesystemIterator::UNIX_PATHS | FilesystemIterator::SKIP_DOTS));
foreach ($fromIterator as $file)
{
if (!file_exists($file->getPathname()))
print $file->getPathname() . "does not exist...\n";
}
我得到一些文件,如: TÜBITAK_UEKAE_Kök_Sertifika_Hizmet_Saglayicisi_Sürüm_3.txt不存在...
有什麼我需要處理這些文件名嗎?
有些爲你閱讀 - http://evertpot.com/filesystem-encoding-and-php/。 TL; DR - Windows非常糟糕。如果這是爲了本地開發,我推薦一個Vagrant LAMP框 – Phil
[PHP:如何創建unicode文件名]的可能重複(http://stackoverflow.com/questions/6467501/php-how-to-create-unicode-filenames ) – Phil
我沒看到那個線程,沒有創建一個文件名。試圖使用現有的文件名PHP已經找到... – RedBullet