[PL]/JAVA
[JSP] getCharacterStream으로 받아서 넘길때 한글 깨짐
객과 함께.
2014. 10. 24. 20:21
Reader reader = null;
try {
reader = rs.getCharacterStream("CONTENT");
char[] buff = new char[512];
int len = -1;
StringBuffer buffer = new StringBuffer(512);
while ((len = reader.read(buff)) != -1) {
buffer.append(buff, 0, len);
}
book.setContent(new String(buffer.toString().getBytes("8859_1"), "UTF-8"));
} catch (IOException iex) {
throw new GuestBookException("getList", iex);
} finally {
if (reader != null)
try {
reader.close();
} catch (IOException iex) {
}
}
정리 차원에서 올리는 글 입니다. 참고만 하시길 .........
자세한 글은 flexmania.tistory.com/43 님 블러그를 참고 하시길...