Posted by 백승용 on October 01, 1997 at 17:19:13:
In Reply to: [질문]오라클 JDBC한글 문제처리 좀? posted by 조태훈 on September 30, 1997 at 19:10:31:
먼저 DB에 저장
다음 메소드를 이용하십시요!
static public String ksc2asc(String str)
{
String result = null;
try {
byte[] rawBytes = str.getBytes("KSC5601");
result = new String(rawBytes, "8859_1");
}
catch (java.io.UnsupportedEncodingException e) {
System.err.println(e.toString());
}
return result;
}
다음에 DB에서 읽은 한글을 TextField나 TextArea에
보여줄때...
static public String asc2ksc(String str)
{
String result = null;
try {
byte[] rawBytes = str.getBytes("8859_1");
result = new String(rawBytes, "KSC5601");
}
catch (java.io.UnsupportedEncodingException e) {
System.err.println(e.toString());
}
return result;
}
많은 참조가 되길......