Sidebar
0 votes
3.1K views
by mike-r-7535 (13.8k points)
edited by michael-h-5027
I have a channel that is an HTTP Listener, and it receives a queryString.  This queryString has an email address, but the @ symbol shows up as %40.  I have tried using qie.unescapeHtml(), but that didn't change anything.  I know the %40 should be @. I think that I want to url decode the %40 to @.

1 Answer

+1 vote
 
Best answer

%40 is a URL encoded @ character.  Java has some helper classes to do this encode and decode URL characters.

To URL encode, use the following:

var originalQueryString = "email=support@qvera.com";

var encodedQueryString =  qie.urlEncode(originalQueryString);

The above results in "email=support%40qvera.com"

To URL decode use the following:

var encodedQueryString = "email=support%40qvera.com";

var decodedQueryString = qie.urlDecode(encodedQueryString);

The above results in "email=support@qvera.com"

Here is a reference for other URL encoding characters.

by mike-r-7535 (13.8k points)
edited by michael-h-5027
...