P
ROTOTYPE
I'm Not Only The Prototype, I'm Also A Member.
home
▪
stats
▪
search
▪
linkback
▪
about
▪
FAQ
| user: guest,
login
,
register
String
:
fromUnicode - convert Unicode string to national encoding
author:
ilya_cat
[+]
,
Submitted: 04.10.03 2a
String.prototype.fromUnicode=function() { var i=0,j=this.length,p=''; if ((this.charAt(0)!='0')||(j%4>0)) { return this; }; do { p+=String.fromCharCode('0x'+this.substr(i,4)); i+=4; } while (i<j); return p; };
usage
usage: [code]a='00680065006c006c006f' b=a.fromUnicode()[/code] [b]b[/b] will be [b]'hello'[/b]
Add Comment
[+]
›opyleft 2001-2010. Layer51 is: Jaime Prado.
@