1 message in com.googlegroups.google-desktop-developerencoding urls
FromSent OnAttachments
Turadg28 Jun 2006 15:02 
Subject:encoding urls
From:Turadg (tur@gmail.com)
Date:06/28/2006 03:02:57 PM
List:com.googlegroups.google-desktop-developer

Is there a function available to do url encoding? I can't find any in the docs, and the ones I've found on the web aren't working in GD Gadget Designer.

For example this one:

function urlEncode(str){ str=escape(str); str=str.replace(new RegExp('\\+','g'),'%2B'); return str.replace(new RegExp('%20','g'),'+'); }

urlEncode("this has spaces and % signs and & signs")

returns

""this+has+spaces+and++signs+and++signs"

It converts the spaces correctly, but loses the % and & characters.