본문 바로가기
카테고리 없음

한글과 unicode의 변환

by eqzero 2006. 8. 8.
// 유니코드를 한글코드로 변환
protected String uni2ksc (String Unicodestr) throws UnsupportedEncodingException {
return new String (Unicodestr.getBytes("8859_1"),"KSC5601");
}

// 한글코드를 유니코드로 변환
protected String ksc2uni(String str) throws UnsupportedEncodingException {
return new String( str.getBytes("KSC5601"), "8859_1");
}


당췌 이놈의 한글처리는 프로젝트마다 어떻게 매번 부딪히는건지 알수가 없다..
물론 같은패턴의 에러는 없다.항상 새로운 에러가 튀어나온다..-_-;;