Eclipse 이클립스 다국어 설정 (UTF-8)

황제낙엽 2006.09.20 11:13 조회 수 : 280 추천:64

sitelink1 http://blog.naver.com/kudolove?Redirect=...0104913531 
sitelink2  
sitelink3  

# 톰캣 UTF-8 한글 설정
1. 톰캣설치폴더/conf/server.xml 파일을 편집기(워드패드, 플러스 에디터 등...)로 엽니다.
2. 찾기(컨트롤+F)로 "Connector port"를 찾습니다. 몇개가 있는데 자신의 포트 번호가 있는 단락을 찾습니다. 

    마지막부분에 그림과 같이 URIEncoding="UTF-8"을 추가해줍니다.
3. 톰캣 서버를 내렸다가 다시 올려줍니다.

 

utf1_free715.jpg

 

 
# 이클립스 UTF-8설정
1.이클립스 설치폴더/eclipse.ini 파일을 역시 편집기로 엽니다.
2. -Dfile.encoding=utf-8를 추가해줍니다.
3. 이클립스를 다시 시작해줍니다.
 

utf2_free715.jpg

 

이렇게 하면

# get방식에서 한글처리는 문제 없습니다. 
# post방식에서 한글처리는 한 가지 절차가 더 필요합니다.

 

코딩 시 파라미터 받기 전에
<%  
  request.setCharacterEncoding("UTF-8");
%>
 
넣어주면 됩니다.

 

 

 

 

# Eclipse Preference 설정 참고

Europa

General > Workspace > Text file encoding > UTF-8
General > Workspace > New text file line delimiter > other (Unix)
General > Content Types > (JAR Content,Java Class File,Text,Word Document) > Default encoding > UTF-8
Web and XML > CSS Files > Creating or saving files (Line delimiter) > UNIX
Web and XML > CSS Files > Creating files (Encoding) > ISO 10646/Unicode(UTF-8)
Web and XML > HTML Files > Creating or saving files (Line delimiter) > UNIX
Web and XML > HTML Files > Creating files (Encoding) > ISO 10646/Unicode(UTF-8)
Web and XML > JavaScript Files > Creating or saving files (Line delimiter) > UNIX
Web and XML > JSP Files > Creating or saving files (Line delimiter) > UNIX
Web and XML > JSP Files > Creating files (Encoding) > ISO 10646/Unicode(UTF-8)
Web and XML > XML Files > Creating or saving files (Line delimiter) > UNIX
Web and XML > XML Files > Creating files (Encoding) > ISO 10646/Unicode(UTF-8)
Web and XML > XML Files > Validating files > Warn when no grammar is specified (check)

 

Juno

 

General > Workspace > Text file encoding에 대해 다음과 같이 UTF-8로 설정

General > Content Types에서 윗부분의 Java Class File을 선택하시고 아래 부분의 Default encoding을 UTF-8로 지정

General > Editor > Text Editors > Spelling 에서 Dictionaries의 Encoding을 UTF-8로 변경

 

 

 

# eclipse + tomcat 구동 환경에서 콘솔이 깨지는 경우

오류가 다음과 같음

4�� 16, 2023 5:10:19 ���� org.apache.catalina.startup.VersionLoggerListener log

INFO: ���� ���� �̸�:    Apache Tomcat/9.0.73

4�� 16, 2023 5:10:19 ���� org.apache.catalina.startup.VersionLoggerListener log

INFO: Server ���� �ð�:  Feb 27 2023 15:33:40 UTC

4�� 16, 2023 5:10:19 ���� org.apache.catalina.startup.VersionLoggerListener log

INFO: Server ���� ��ȣ:  9.0.73.0

4�� 16, 2023 5:10:19 ���� org.apache.catalina.startup.VersionLoggerListener log

INFO: �ü�� �̸�:     Windows 10

4�� 16, 2023 5:10:19 ���� org.apache.catalina.startup.VersionLoggerListener log

INFO: �ü�� ����:     10.0

 

윈도우의 이클립스 환경의 경우 eclipse.ini, workspaces 와 project 모두 utf-8 로 설정했는데도 유독 톰캣 구동 콘솔 화면만 위와 같이 깨졌다 

- 프로젝트 우클릭 > Run As > Run Configurations...

- Common 탭에서 Encoding 을 바꿔본다

- default(utf-8) 로 설정되어 있다면 'Use system encoding' 으로 변경한다

 

캡처.PNG

위와 같이 설정하면 tomcat 내에서 출력하는 한글 메세지의 출력은 정상 출력하게 된다

하지만 logging 프로그램을 통해 콘솔에 출력하는 경우 콘솔이 utf-8 이 아니기 때문에 프로그램 로그들의 한글이 깨져버리게 된다

두가지 모두 깨지지 않으려면 다른 방법으로 설정해야만 한다 (현재까지 찾지 못함)

 

번호 제목 글쓴이 날짜 조회 수
78 INSTALL_FAILED_NO_MATCHING_ABIS WHEN INSTALL APK ? file 황제낙엽 2017.03.28 11539
77 svn: E175002: connection refused by the server 황제낙엽 2019.06.21 3845
76 리팩토링 (Refactoring) 사용하기 황제낙엽 2007.07.27 2803
75 Eclipse TODO 사용법 / Task Tags 사용법 황제낙엽 2018.01.23 1923
74 [Android Studio] Unsupported major.minor version 52.0 황제낙엽 2016.08.18 1200
73 [Android Studio] Error:Execution failed for task ':app:compileDebugJavaWithJavac'. 황제낙엽 2016.08.18 582
72 The ObjectAid UML Explorer for Eclipse (Reverse Engineering) 황제낙엽 2016.12.08 524
71 Eclipse 인터페이스는 영문, 도움말은 한글로 보기 황제낙엽 2007.03.07 489
70 Setting property 'source' to 'org.eclipse.jst.jee.server:board' did not find a matching property. 황제낙엽 2013.04.11 448
69 Eclipse Javadoc 의 Author 설정하기 file 황제낙엽 2017.06.05 389
68 workspace 자동 refresh 황제낙엽 2017.07.09 319
67 APK파일 생성 (명령줄에서 앱 빌드) 황제낙엽 2019.10.08 283
» 이클립스 다국어 설정 (UTF-8) file 황제낙엽 2006.09.20 280
65 java.net과 이클립스를 이용한 오픈소스 자바 어플리케이션 개발 (1부. 이클립스에서 새로운 프로젝트 생성하기) file 황제낙엽 2007.02.28 254
64 255자 넘는 경로명을 가진 파일/디렉토리 강제 삭제하기 file 황제낙엽 2015.11.21 252
63 Analyze APK 황제낙엽 2019.10.08 245
62 svn:ignore 추가 방법 file 황제낙엽 2018.04.13 239
61 "탭(tab) 1" to "스페이스(space) 4" 로 변경 황제낙엽 2017.01.20 224
60 Java was started but returned exit code=13 file 황제낙엽 2018.03.25 201
59 Eclipse 관련 FAQ 황제낙엽 2005.10.13 188