개발하다가 환경에 따라 한글이 깨지는 경우가 있는데,
그런 경우, 지원되는 한글을 확인하기 위한 소스
// 인코딩 변환 테스트
String charset[] = {"UTF-8", "MS949", "EUC-KR", "ksc5601", "x-windows-949", "ISO-2022-KR"
, "x-IBM833", "x-IBM834", "x-IBM933", "x-IBM949", "x-IBM970", "x-Johab"};
String strTest = "가나다 123";
System.out.println("strTest : " + strTest);
for (String charset1 : charset){
System.out.println(charset1 + " = " + new String(strTest.getBytes(Charset.forName(charset1))));
for (String charset2 : charset){
System.out.println(charset1 + " -> " + charset2 + " = "
+ new String(strTest.getBytes(Charset.forName(charset1)), Charset.forName(charset2)));
}
System.out.println(" ");
}
결과는 개발 환경에 따라 다르게 나올수도 있다.
file.encoding = UTF-8
strTest : 가나다 123
UTF-8 = 가나다 123
UTF-8 -> UTF-8 = 가나다 123
UTF-8 -> MS949 = 媛��굹�떎 123
UTF-8 -> EUC-KR = 媛����� 123
UTF-8 -> ksc5601 = 媛����� 123
UTF-8 -> x-windows-949 = 媛��굹�떎 123
UTF-8 -> ISO-2022-KR = ê°ëë¤ 123
UTF-8 -> x-IBM833 = �^]�bq�ᅢu
UTF-8 -> x-IBM834 = ����떪�����
UTF-8 -> x-IBM933 = �^]�bq�ᅢu
UTF-8 -> x-IBM949 = 媛¢�\�� 123
UTF-8 -> x-IBM970 = 媛���123
UTF-8 -> x-Johab = 煞��떪긳 123
MS949 = ������ 123
MS949 -> UTF-8 = ������ 123
MS949 -> MS949 = 가나다 123
MS949 -> EUC-KR = 가나다 123
MS949 -> ksc5601 = 가나다 123
MS949 -> x-windows-949 = 가나다 123
MS949 -> ISO-2022-KR = °¡³ª´Ù 123
MS949 -> x-IBM833 = ^~�ᅭ�R
MS949 -> x-IBM834 = 쌰�������
MS949 -> x-IBM933 = ^~�ᅭ�R
MS949 -> x-IBM949 = 가나다 123
MS949 -> x-IBM970 = 가나다 123
MS949 -> x-Johab = 쌰씱얯 123
EUC-KR = ������ 123
EUC-KR -> UTF-8 = ������ 123
EUC-KR -> MS949 = 가나다 123
EUC-KR -> EUC-KR = 가나다 123
EUC-KR -> ksc5601 = 가나다 123
EUC-KR -> x-windows-949 = 가나다 123
EUC-KR -> ISO-2022-KR = °¡³ª´Ù 123
EUC-KR -> x-IBM833 = ^~�ᅭ�R
EUC-KR -> x-IBM834 = 쌰�������
EUC-KR -> x-IBM933 = ^~�ᅭ�R
EUC-KR -> x-IBM949 = 가나다 123
EUC-KR -> x-IBM970 = 가나다 123
EUC-KR -> x-Johab = 쌰씱얯 123
ksc5601 = ������ 123
ksc5601 -> UTF-8 = ������ 123
ksc5601 -> MS949 = 가나다 123
ksc5601 -> EUC-KR = 가나다 123
ksc5601 -> ksc5601 = 가나다 123
ksc5601 -> x-windows-949 = 가나다 123
ksc5601 -> ISO-2022-KR = °¡³ª´Ù 123
ksc5601 -> x-IBM833 = ^~�ᅭ�R
ksc5601 -> x-IBM834 = 쌰�������
ksc5601 -> x-IBM933 = ^~�ᅭ�R
ksc5601 -> x-IBM949 = 가나다 123
ksc5601 -> x-IBM970 = 가나다 123
ksc5601 -> x-Johab = 쌰씱얯 123
x-windows-949 = ������ 123
x-windows-949 -> UTF-8 = ������ 123
x-windows-949 -> MS949 = 가나다 123
x-windows-949 -> EUC-KR = 가나다 123
x-windows-949 -> ksc5601 = 가나다 123
x-windows-949 -> x-windows-949 = 가나다 123
x-windows-949 -> ISO-2022-KR = °¡³ª´Ù 123
x-windows-949 -> x-IBM833 = ^~�ᅭ�R
x-windows-949 -> x-IBM834 = 쌰�������
x-windows-949 -> x-IBM933 = ^~�ᅭ�R
x-windows-949 -> x-IBM949 = 가나다 123
x-windows-949 -> x-IBM970 = 가나다 123
x-windows-949 -> x-Johab = 쌰씱얯 123
ISO-2022-KR = $)C0!3*4Y 123
ISO-2022-KR -> UTF-8 = $)C0!3*4Y 123
ISO-2022-KR -> MS949 = $)C0!3*4Y 123
ISO-2022-KR -> EUC-KR = $)C0!3*4Y 123
ISO-2022-KR -> ksc5601 = $)C0!3*4Y 123
ISO-2022-KR -> x-windows-949 = $)C0!3*4Y 123
ISO-2022-KR -> ISO-2022-KR = 가나다 123
ISO-2022-KR -> x-IBM833 = ᄀᆵ
ISO-2022-KR -> x-IBM834 = ��������������
ISO-2022-KR -> x-IBM933 = ᄀ���
ISO-2022-KR -> x-IBM949 = $)C0!3*4Y 123
ISO-2022-KR -> x-IBM970 = $)C0!3*4Y 123
ISO-2022-KR -> x-Johab = $)C0!3*4Y 123
x-IBM833 = ???@���
x-IBM833 -> UTF-8 = ???@���
x-IBM833 -> MS949 = ???@增�
x-IBM833 -> EUC-KR = ???@增�
x-IBM833 -> ksc5601 = ???@增�
x-IBM833 -> x-windows-949 = ???@增�
x-IBM833 -> ISO-2022-KR = ???@ñòó
x-IBM833 -> x-IBM833 = 123
x-IBM833 -> x-IBM834 = ������
x-IBM833 -> x-IBM933 = 123
x-IBM833 -> x-IBM949 = ???@增�
x-IBM833 -> x-IBM970 = ???@增�
x-IBM833 -> x-Johab = ???@粧�
x-IBM834 = �a�a�a��������
x-IBM834 -> UTF-8 = �a�a�a��������
x-IBM834 -> MS949 = 늏륾봞
x-IBM834 -> EUC-KR = �a�a�a��������
x-IBM834 -> ksc5601 = �a�a�a��������
x-IBM834 -> x-windows-949 = 늏륾봞
x-IBM834 -> ISO-2022-KR = aaaþþþþþþþþ
x-IBM834 -> x-IBM833 = h/�/m/��������
x-IBM834 -> x-IBM834 = 가나다��������
x-IBM834 -> x-IBM933 = h/�/m/��������
x-IBM834 -> x-IBM949 = �a�a�a
x-IBM834 -> x-IBM970 = aaa
x-IBM834 -> x-Johab = 가나다��������
x-IBM933 = �a�a�a@���
x-IBM933 -> UTF-8 = �a�a�a@���
x-IBM933 -> MS949 = 늏륾봞@增�
x-IBM933 -> EUC-KR = �a�a�a@增�
x-IBM933 -> ksc5601 = �a�a�a@增�
x-IBM933 -> x-windows-949 = 늏륾봞@增�
x-IBM933 -> ISO-2022-KR = ���@ñòó
x-IBM933 -> x-IBM833 = h/�/m/ 123
x-IBM933 -> x-IBM834 = �가나다����
x-IBM933 -> x-IBM933 = 가나다 123
x-IBM933 -> x-IBM949 = �a�a�a@增�
x-IBM933 -> x-IBM970 = aaa@增�
x-IBM933 -> x-Johab = 가나다@粧�
x-IBM949 = ������ 123
x-IBM949 -> UTF-8 = ������ 123
x-IBM949 -> MS949 = 가나다 123
x-IBM949 -> EUC-KR = 가나다 123
x-IBM949 -> ksc5601 = 가나다 123
x-IBM949 -> x-windows-949 = 가나다 123
x-IBM949 -> ISO-2022-KR = °¡³ª´Ù 123
x-IBM949 -> x-IBM833 = ^~�ᅭ�R
x-IBM949 -> x-IBM834 = 쌰�������
x-IBM949 -> x-IBM933 = ^~�ᅭ�R
x-IBM949 -> x-IBM949 = 가나다 123
x-IBM949 -> x-IBM970 = 가나다 123
x-IBM949 -> x-Johab = 쌰씱얯 123
x-IBM970 = ������ 123
x-IBM970 -> UTF-8 = ������ 123
x-IBM970 -> MS949 = 가나다 123
x-IBM970 -> EUC-KR = 가나다 123
x-IBM970 -> ksc5601 = 가나다 123
x-IBM970 -> x-windows-949 = 가나다 123
x-IBM970 -> ISO-2022-KR = °¡³ª´Ù 123
x-IBM970 -> x-IBM833 = ^~�ᅭ�R
x-IBM970 -> x-IBM834 = 쌰�������
x-IBM970 -> x-IBM933 = ^~�ᅭ�R
x-IBM970 -> x-IBM949 = 가나다 123
x-IBM970 -> x-IBM970 = 가나다 123
x-IBM970 -> x-Johab = 쌰씱얯 123
x-Johab = �a�a�a 123
x-Johab -> UTF-8 = �a�a�a 123
x-Johab -> MS949 = 늏륾봞 123
x-Johab -> EUC-KR = �a�a�a 123
x-Johab -> ksc5601 = �a�a�a 123
x-Johab -> x-windows-949 = 늏륾봞 123
x-Johab -> ISO-2022-KR = aaa 123
x-Johab -> x-IBM833 = h/�/m/
x-Johab -> x-IBM834 = 가나다����
x-Johab -> x-IBM933 = h/�/m/
x-Johab -> x-IBM949 = �a�a�a 123
x-Johab -> x-IBM970 = aaa 123
x-Johab -> x-Johab = 가나다 123
<참고> JAVA 에서 지원하는 Encoding 종류
https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html
'프로그래밍 > JAVA' 카테고리의 다른 글
[WEB] 페이지 로딩시 특정기간 동안 레이어 팝업 표시 (1) | 2024.11.19 |
---|---|
[인텔리제이 IDE] 심볼을 찾을 수 없습니다. Cannot resolve symbol. 해결 방법 (0) | 2024.01.18 |
[SpringBoot] Gradle에서 bootjar 실행시 Entry META-INF/MANIFEST.MF is a duplicate but no duplicate handling strategy has been set 오류 해결 방법 (0) | 2024.01.10 |
Spring Quartz 표현식 정리 (1) | 2023.12.15 |
Apache JMeter 5.2 설치 / 설정 (0) | 2023.08.31 |
댓글