Created
August 1, 2014 08:46
-
-
Save ohjongin/7a942e0305569aa25b9d to your computer and use it in GitHub Desktop.
유니코드 vs. 한글코드로 상호 변환
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from: http://www.senun.com/Left/Programming/Java/Jsp/jsp_syntax_hangul.htm | |
// 유니코드를 한글코드로 변환 | |
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"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment