<script type="text/javascript">
var e2k = (function() {
var en_h = "rRseEfaqQtTdwWczxvg";
var reg_h = "[" + en_h + "]";
var en_b = {k:0,o:1,i:2,O:3,j:4,p:5,u:6,P:7,h:8,hk:9,ho:10,hl:11,y:12,n:13,nj:14,np:15,nl:16,b:17,m:18,ml:19,l:20};
var reg_b = "hk|ho|hl|nj|np|nl|ml|k|o|i|O|j|p|u|P|h|y|n|b|m|l";
var en_f =
{"":0,r:1,R:2,rt:3,s:4,sw:5,sg:6,e:7,f:8,fr:9,fa:10,fq:11,ft:12,fx:13,fv:14,fg:15,a:16,q:17,qt:18,t:19,T:20,d:21,w:22,c:23,z:24,x:25,v:26,g:27};
var reg_f = "rt|sw|sg|fr|fa|fq|ft|fx|fv|fg|qt|r|R|s|e|f|a|q|t|T|d|w|c|z|x|v|g|";
var reg_exp = new RegExp("("+reg_h+")("+reg_b+")(("+reg_f+")(?=("+reg_h+")("+reg_b+"))|("+reg_f+"))","g");
var replace = function(str,h,b,f) {
return String.fromCharCode(en_h.indexOf(h) * 588 + en_b[b] * 28 + en_f[f] + 44032);
};
return (function(str) {
return str.replace(reg_exp,replace);
});
})();
// Test
alert(e2k("rkwl dksgdms rlf - fhqjxm vmfhtmxm"));
</script>
'IT 자료' 카테고리의 다른 글
[FMWGEN][DB2 JDBC Driver]Transliteration failed, reason: invalid UTF8 data (0) | 2015.08.20 |
---|---|
input text 한글로 입력 (0) | 2015.08.13 |
DB2 날짜 계산 (0) | 2015.08.06 |
ajax에서 form양식 보낼때 (0) | 2015.07.30 |
html의 select의 value와 text 가져오는 방법 (0) | 2015.07.30 |