byte[] bytes = query.getBytes("utf-8");
query = new String(bytes);
String[] charSet = {"utf-8", "euc-kr", "ksc5601", "iso-8859-1", "x-windows-949"};
for(int i = 0; i<charSet.length; i++){
for(int j = 0; j<charSet.length; j++){
try{
System.out.println("[" + charSet[i] + "," + charSet[j] + "]" + new String(query.getBytes(charSet[i]), charSet[j]));
} catch (UnsupportedEncodingException e){
e.printStackTrace();
}
}
}
문자열을 getBytes("charSet") 메소드
[utf-8,utf-8]회사 주소는 ?
[utf-8,euc-kr]���� 二쇱���� ?
[utf-8,ksc5601]���� 二쇱���� ?
[utf-8,iso-8859-1]íì¬ ì£¼ìë ?
[utf-8,x-windows-949]�쉶�궗 二쇱냼�뒗 ?
[euc-kr,utf-8]ȸ�� �ּҴ� ?
[euc-kr,euc-kr]회사 주소는 ?
[euc-kr,ksc5601]회사 주소는 ?
[euc-kr,iso-8859-1]ȸ»ç ÁÖ¼Ò´Â ?
[euc-kr,x-windows-949]회사 주소는 ?
[ksc5601,utf-8]ȸ�� �ּҴ� ?
[ksc5601,euc-kr]회사 주소는 ?
[ksc5601,ksc5601]회사 주소는 ?
[ksc5601,iso-8859-1]ȸ»ç ÁÖ¼Ò´Â ?
[ksc5601,x-windows-949]회사 주소는 ?
[iso-8859-1,utf-8]?? ??? ?
[iso-8859-1,euc-kr]?? ??? ?
[iso-8859-1,ksc5601]?? ??? ?
[iso-8859-1,iso-8859-1]?? ??? ?
[iso-8859-1,x-windows-949]?? ??? ?
[x-windows-949,utf-8]ȸ�� �ּҴ� ?
[x-windows-949,euc-kr]회사 주소는 ?
[x-windows-949,ksc5601]회사 주소는 ?
[x-windows-949,iso-8859-1]ȸ»ç ÁÖ¼Ò´Â ?
[x-windows-949,x-windows-949]회사 주소는 ?