알쓸신잡
인텔리제이 properties 한글 인코딩 - error화면 출력시 ???? 발생
chandlerxx
2023. 11. 30. 19:16
고생 좀 했는데 IDE관련 설정 문제였네요.
1. 오류발생
오류 코드를 관리하고 처리하기 위해 errors.properties를 도입했습니다. 사용자의 입력값이 조건에 맞지 않으면 오류 코드를 출력합니다.
그러나. 한글 출력이 안됨.
2. 원인&해결
공식 문서을 살펴보면 IDE 관련 문제로 보입니다.
자바 표준에 한글이 정의되어 있지 않다면 이스케이프 시퀀스로 인식된다. 그런 경우 설정 방법을 변경해주면 된다.
<Encoding of properties files>
The Java 1.8 API is designed to use the ISO 8859-1 encoding for properties files. You can use escape sequences for characters that are not defined by this encoding.
<Configure default encoding>
If necessary, enable Transparent native-to-ascii conversion to show national characters (those not defined in ISO 8859-1) in place of the corresponding escape sequences.
3. 정상 작동 확인
[출처]