2013-03-02 3 views
2

CentOS 서버에 PHP가 설치되어 있으며이 파일 (PHP FTP 사용)을 IIS가 실행되는 Windows FTP 서버로 전송하고 싶습니다. 이제 문제는 파일 이름에 비 라틴 문자가있을 때 'تست.3gp'와 같은 파일 이름으로 바뀝니다 (CentOS의 이름은 .3 gp입니다.) 여러 번 검색했지만 해결책이 없습니다. 이 문제를 어떻게 해결할 수 있습니까?복사 된 파일 이름이 왜곡됩니다.

Windows에서는 CP-1252 (Windows-1252)를 charset으로 사용하고 CentOS는 UTF-8을 charset으로 사용한다고 생각합니다. 그러나 이것을 iconv()mb_convert_encoding()으로 변환하지 못했습니다.

+1

이 참조 나는이 질문에 대답했다. http://stackoverflow.com/questions/15055192/why-does-windows-need-to-utf8-decode-filenames-for-file-get-contents-to-work/15055869#15055869 –

+0

그것은 작동하지 않습니다 – IVIR3zaM

+0

그것은 나를 위해 올바르게 작동합니다. 문제? –

답변

0

또한 우리는 mb_convert_encoding() 이러한 코딩을 사용할 수 있습니다

// Cyrillic script such as Russian, Bulgarian, Serbian Cyrillic and other languages Windows-1251 ~= ISO-8859-5 

// Latin alphabet Windows-1252 ~= ISO-8859-1 // sometimes called incorrectly "ANSI" 

//modern Greek. It is not capable of supporting the older polytonic Greek. It is not fully compatible with ISO 8859-7 because the letters like Ά are located at different byte values Windows-1253 ~= ISO-8859-7 

// Turkish Windows-1254 = ISO-8859-9 

// Hebrew Windows-1255 = ISO-8859-8 

// Arabic script like Persian and Urdu Windows-1256 ~= ISO-8859-6 

// Estonian, Latvian and Lithuanian languages Windows-1257 != ISO-8859-4 

// Vietnamese texts. It is very similar to Windows-1252 with the differences being that s-caron and z-caron Windows-1258 ~= Windows-1252 

내가 페르시아어 파일 이름이 코드를 사용 :

$filename=iconv('UTF-8','Windows-1256//IGNORE',$filename); 
관련 문제