encodeURIComponent was the solution, thank you so  much ! :)

On 5 mar, 18:30, Cerebrus <[email protected]> wrote:
> 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 <[email protected]> wrote:
>
> > 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 <[email protected]> wrote:
>
> > > 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 <[email protected]> wrote:
>
> > > > 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- Hide quoted text -
>
> > - Show quoted text -

Reply via email to