http://scriptasylum.com/tutorials/encdec/encode-decode.html

you will need to use the escape and unescape functions.