2014년 8월 6일 수요일

자바 String 인코딩 찾기

01.String word = s;
02.System.out.println("utf-8(1) : " new String(word.getBytes("utf-8"), "euc-kr"));
03.System.out.println("utf-8(2) : " new String(word.getBytes("utf-8"), "ksc5601"));
04.System.out.println("utf-8(3) : " new String(word.getBytes("utf-8"), "x-windows-949"));
05.System.out.println("utf-8(4) : " new String(word.getBytes("utf-8"), "iso-8859-1"));
06. 
07.System.out.println("iso-8859-1(1) : " new String(word.getBytes("iso-8859-1"), "euc-kr"));
08.System.out.println("iso-8859-1(2) : " new String(word.getBytes("iso-8859-1"), "ksc5601"));
09.System.out.println("iso-8859-1(3) : " new String(word.getBytes("iso-8859-1"), "x-windows-949"));
10.System.out.println("iso-8859-1(4) : " new String(word.getBytes("iso-8859-1"), "utf-8"));
11. 
12.System.out.println("euc-kr(1) : " new String(word.getBytes("euc-kr"), "ksc5601"));
13.System.out.println("euc-kr(2) : " new String(word.getBytes("euc-kr"), "utf-8"));
14.System.out.println("euc-kr(3) : " new String(word.getBytes("euc-kr"), "x-windows-949"));
15.System.out.println("euc-kr(4) : " new String(word.getBytes("euc-kr"), "iso-8859-1"));
16. 
17.System.out.println("ksc5601(1) : " new String(word.getBytes("ksc5601"), "euc-kr"));
18.System.out.println("ksc5601(2) : " new String(word.getBytes("ksc5601"), "utf-8"));
19.System.out.println("ksc5601(3) : " new String(word.getBytes("ksc5601"), "x-windows-949"));
20.System.out.println("ksc5601(4) : " new String(word.getBytes("ksc5601"), "iso-8859-1"));
21. 
22.System.out.println("x-windows-949(1) : " new String(word.getBytes("x-windows-949"), "euc-kr"));
23.System.out.println("x-windows-949(2) : " new String(word.getBytes("x-windows-949"), "utf-8"));
24.System.out.println("x-windows-949(3) : " new String(word.getBytes("x-windows-949"), "ksc5601"));
25.System.out.println("x-windows-949(4) : " new String(word.getBytes("x-windows-949"), "iso-8859-1"));

댓글 없음:

댓글 쓰기