2011년 11월 20일 일요일

SCM - 이클립스 상의 파일 UTF-8 인코딩 설정

In the eclipse IDE the default encoding can (and must) be set to UTF-8. This can be done under Window | Preferences | General | Workspace | Text file encoding



Additionally, there are file-type specific settings under Window | Preferences | General | Content Types



The encoding of a newly created file, of course, may be defined here: Window | Preferences | Web and XML | ... files
where you have to set the file encoding for each kind of file separately.



In addition, eclipse should be started given UTF-8 as default encoding. This can be done with an additional startup property in the eclipse.ini file:

add -Dfile.encoding=UTF-8 at the end of eclipse.ini.




참고: 커맨드(iconv)를 이용한 파일 인코딩 변환방법 (Linux/Unix)

사용방법
$ iconv [옵션] [원본파일]
옵션:
-f 원본파일의 인코딩 방식
-t 콘솔출력의 인코딩 방식

변환 예 EUC-KR 인코딩 파일을 UTF8로 변환하기
$ iconv -f EUC-KR -t UTF8 test_euc_kr.txt > test_utf.txt



This is also useful when launching applications from eclipse. Add the above parameter to the arguments: Run| Run Configurations| Arguments | VM Arguments

댓글 없음:

댓글 쓰기