문제 설명
FTP 바이너리 전송 후의 Charset (Charset after FTP binary transfer)
우리는 두 대의 머신(unix와 windows)을 가지고 있으며 첫 번째(unix [IBM1047])에서 두 번째(windows [UTF16])로 FTP를 통해 파일을 보냅니다. ASCII 모드를 사용하는 경우 Ñ ó...와 같은 일부 특수 문자가 올바르게 표시되지 않습니다. 그래서 우리는 BINARY 모드로 변경했고 전송 후 charset 파일을 UTF16으로 설정했습니다. 그러나 표시되지 않는 캐리지를 반환하는 것을 제외하고는 모든 것이 잘 작동합니다(파일의 1줄).
그래서 우리가 놓치고 있는 것은 무엇입니까?
참조 솔루션
방법 1:
Binary mode means that there are no changes done to the file, which includes changes on the line endings. UNIX and Windows have traditionally different line endings, i.e. \n on UNIX vs. \r\n on Windows. If your application is not able to deal with UNIX‑style line endings you have to convert all the line endings in the file. See also Windows command to convert Unix line endings?.
(by Fran b、Steffen Ullrich)