본문으로 바로가기

String Encoding Check

category Backend/Java 2019. 9. 26. 10:24
반응형

String Encoding Check


String originalStr = "A×½ºÆ®"// 테스트 
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++) {
    System.out.println("[" + charSet[i] +"," + charSet[j] +"] = " + new String(originalStr.getBytes(charSet[i]), charSet[j]));
  }
}



반응형