웹 페이지에서 일부 샘플 코드의 복사본으로 시작된 소스 코드 파일이 있습니다. Windows에서 작성 및 편집되었으며 문제없이 컴파일되었습니다.텍스트 파일에서 특수 문자를 제거하는 방법은 무엇입니까? (* nix)
는하지만 맥에서 내가 좋아하는, 모호한 오류의 부하를 얻을 : 문제가 일부 특수 문자처럼
../MyProgram.cpp:1: error: stray '\255' in program
../MyProgram.cpp:1: error: stray '\254' in program
../MyProgram.cpp:1: error: stray '#' in program
../MyProgram.cpp:3:4: error: invalid preprocessing directive #i
../MyProgram.cpp:5:4: error: invalid preprocessing directive #i
../MyProgram.cpp:7:4: error: invalid preprocessing directive #i
../MyProgram.cpp:23: error: missing terminating ' character
../MyProgram.cpp:369:6: error: invalid preprocessing directive #i
../MyProgram.cpp:371:8: error: invalid preprocessing directive #i
../MyProgram.cpp:375:8: error: invalid preprocessing directive #e
../MyProgram.cpp:381:8: error: invalid preprocessing directive #e
../MyProgram.cpp:383:6: error: invalid preprocessing directive #e
../MyProgram.cpp:385:8: error: invalid preprocessing directive #i
../MyProgram.cpp:389:8: error: invalid preprocessing directive #e
../MyProgram.cpp:1: error: 'i' does not name a type
../MyProgram.cpp:53: error: 'V' does not name a type
../MyProgram.cpp:75: error: 'v' does not name a type
../MyProgram.cpp:157: error: 'l' does not name a type
../MyProgram.cpp:169: error: 'l' does not name a type
../MyProgram.cpp:187: error: 'i' does not name a type
../MyProgram.cpp:197: error: 'v' does not name a type
보인다.
* nix 명령 줄을 사용하여 어떻게 제거 할 수 있습니까?
많은 유닉스 배포판에는/usr/bin에 있어야하는 dos2unix 유틸리티가 있습니다. OSX에 대한 확신이 없습니다 ... – Alex
http://dos2unix.darwinports.com/ – Jon
문제는 특수 문자가 아닙니다. 그것은 UTF-16입니다 : FFFE는 당신의 힌트입니다. –