Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Problem with UrlDecode
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
graphicsxp  
View profile  
 More options Mar 5, 5:23 am
From: graphicsxp <graphic...@googlemail.com>
Date: Thu, 5 Mar 2009 02:23:43 -0800 (PST)
Local: Thurs, Mar 5 2009 5:23 am
Subject: Problem with UrlDecode
Hello,

I'm passing the following string in my querystring :  "test & test £"
and I encode the string in javascript so that the server receives :
test%20%26%20test%20%A3

All is fine but when I use Server.UrlDecode in my server code, the
string is decoded as : "test & test 'square' "

in place of square, it is an actual square shape, like the %A3 bit was
not decoded properly to a £ sign.

What am I doing wrong ?

Thank you


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cerebrus  
View profile  
 More options Mar 5, 12:03 pm
From: Cerebrus <zorg...@sify.com>
Date: Thu, 5 Mar 2009 09:03:19 -0800 (PST)
Local: Thurs, Mar 5 2009 12:03 pm
Subject: Re: Problem with UrlDecode
You haven't explained how you are encoding the URL via Javascript.
Whatever that method is, it appears to be incorrectly encoding the
Pound symbol. The encoded value of the symbol should be "%C2%A3".

I would suggest that you use the encodeURI() built-in function in
Javascript.

On Mar 5, 3:23 pm, graphicsxp <graphic...@googlemail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
graphicsxp  
View profile  
 More options Mar 5, 1:02 pm
From: graphicsxp <graphic...@googlemail.com>
Date: Thu, 5 Mar 2009 10:02:38 -0800 (PST)
Local: Thurs, Mar 5 2009 1:02 pm
Subject: Re: Problem with UrlDecode
Thanks for helping

I am using encodeURI() but at the same time I was using escape(). If I
use encodeURI() alone, then it is converted to %C2%A3 and all is fine.
However if I don't use escape() then all my ampersand (&) are just
discarded.

If I pass 'test & £' in my querystring, when I try to decode that on
the server end, it becomes 'test £'

Maybe it's more a javascript issue and I shouldn't post here but I'm
not sure.....

On 5 mar, 17:03, Cerebrus <zorg...@sify.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cerebrus  
View profile  
 More options Mar 5, 1:30 pm
From: Cerebrus <zorg...@sify.com>
Date: Thu, 5 Mar 2009 10:30:38 -0800 (PST)
Local: Thurs, Mar 5 2009 1:30 pm
Subject: Re: Problem with UrlDecode
It's all right... Javascript has become so deeply integrated with all
web technologies that I hardly notice that this is not a Javascript
Group. So, don't worry, we cater to Javascript as well <fanfare
music> !!!

Instead of using escape() which is not recommended, try using the
encodeURIComponent() method instead which should do the conversion
properly. I haven't tried it, but I think it should be able to handle
the Pound sign.

On Mar 5, 11:02 pm, graphicsxp <graphic...@googlemail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
graphicsxp  
View profile  
 More options Mar 6, 4:38 am
From: graphicsxp <graphic...@googlemail.com>
Date: Fri, 6 Mar 2009 01:38:43 -0800 (PST)
Local: Fri, Mar 6 2009 4:38 am
Subject: Re: Problem with UrlDecode
encodeURIComponent was the solution, thank you so  much ! :)

On 5 mar, 18:30, Cerebrus <zorg...@sify.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google