4umi.com/web/javascript/unescape

Escape

Text Javascript

All characters were created equally special, but the escaping and unescaping of strings allows some characters to be more special than others.

The script

It all speaks for itself.

for( var a=[], i=0; i<256; i++ ) {
 a[a.length] =  i.toString(16);
}
a = '%' + a.join( '%' );

gid( 'escaped' ).lastChild.nodeValue = a;
gid( 'unescaped' ).lastChild.nodeValue = unescape( a );

The output

Escaped 
Unescaped