[ java ] in KIDS 글 쓴 이(By): being (빙) 날 짜 (Date): 1998년01월20일(화) 14시09분03초 ROK 제 목(Title): JDBC에서 깨진 한글 보기 JDBC에서 스트링을 읽었을 때, 한글이 깨지는 경우 다음 함수를 쓰십시요. 깨진 한글 String을 다음 함수의 패러미터로 넣으면, return되는 스트링은 올바른 한글 String이 됩니다. public String asc2ksc(String str) { if(str == null) return null; String result = null; byte[] rawBytes = null; try { rawBytes = str.getBytes("8859_1"); result = new String(rawBytes, "KSC5601"); } catch(java.io.UnsupportedEncodingException e) { System.err.println(e.toString()); } return result; } |