PC Review


Reply
Thread Tools Rate Thread

Decode URL string

 
 
Snedker
Guest
Posts: n/a
 
      1st Sep 2008
As part of URL I have ie:

www.website.com?test=%F8%E5%C6%D8%C5

Requesting the querystring and displaying the content on web I just
get a bunch of squares instead of the special Danish characters that I
expect. But I don't know how to decode them properly. Do you?

Any help or pointer in the right direction is greatly appreciated -
thanks in advance!


Kind regards /Snedker
 
Reply With Quote
 
 
 
 
Florian Paulus
Guest
Posts: n/a
 
      1st Sep 2008
Snedker wrote:
> As part of URL I have ie:
>
> www.website.com?test=%F8%E5%C6%D8%C5
>
> Requesting the querystring and displaying the content on web I just
> get a bunch of squares instead of the special Danish characters that I
> expect. But I don't know how to decode them properly. Do you?
>
> Any help or pointer in the right direction is greatly appreciated -
> thanks in advance!
>
>
> Kind regards /Snedker


How are you trying to decode them?
 
Reply With Quote
 
Snedker
Guest
Posts: n/a
 
      1st Sep 2008
On 1 Sep., 14:14, Florian Paulus <florian.pau...@sc-cis.de> wrote:
> Snedker wrote:
> > As part of URL I have ie:

>
> >www.website.com?test=%F8%E5%C6%D8%C5

>
> > Requesting the querystring and displaying the content on web I just
> > get a bunch of squares instead of the special Danish characters that I
> > expect. But I don't know how to decode them properly. Do you?

>
> > Any help or pointer in the right direction is greatly appreciated -
> > thanks in advance!

>
> > Kind regards /Snedker

>
> How are you trying to decode them?


Using System.Web.SystemHttpUtility.UrlDecode is what I've tried, but
not with the result of "squares"...

Regards /Snedker
 
Reply With Quote
 
Snedker
Guest
Posts: n/a
 
      1st Sep 2008
On 1 Sep., 14:32, Snedker <Morten.Sned...@gmail.com> wrote:
> On 1 Sep., 14:14, Florian Paulus <florian.pau...@sc-cis.de> wrote:
>
> > Snedker wrote:
> > > As part of URL I have ie:

>
> > >www.website.com?test=%F8%E5%C6%D8%C5

>
> > > Requesting the querystring and displaying the content on web I just
> > > get a bunch of squares instead of the special Danish characters that I
> > > expect. But I don't know how to decode them properly. Do you?

>
> > > Any help or pointer in the right direction is greatly appreciated -
> > > thanks in advance!

>
> > > Kind regards /Snedker

>
> > How are you trying to decode them?

>
> Using System.Web.SystemHttpUtility.UrlDecode is what I've tried, but
> not with the result of "squares"...
>
> Regards /Snedker


...but WITH the result of squares, that is... :-)
/snedker
 
Reply With Quote
 
Florian Paulus
Guest
Posts: n/a
 
      1st Sep 2008
Snedker wrote:
> On 1 Sep., 14:32, Snedker <Morten.Sned...@gmail.com> wrote:
>> On 1 Sep., 14:14, Florian Paulus <florian.pau...@sc-cis.de> wrote:
>>
>>> Snedker wrote:
>>>> As part of URL I have ie:
>>>> www.website.com?test=%F8%E5%C6%D8%C5
>>>> Requesting the querystring and displaying the content on web I just
>>>> get a bunch of squares instead of the special Danish characters that I
>>>> expect. But I don't know how to decode them properly. Do you?
>>>> Any help or pointer in the right direction is greatly appreciated -
>>>> thanks in advance!
>>>> Kind regards /Snedker
>>> How are you trying to decode them?

>> Using System.Web.SystemHttpUtility.UrlDecode is what I've tried, but
>> not with the result of "squares"...
>>
>> Regards /Snedker

>
> ..but WITH the result of squares, that is... :-)
> /snedker

Did you try to set the default encodings to utf-8 in your web.config?

<configuration>
<system.web>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8" />
</system.web>
</configuration>
 
Reply With Quote
 
Snedker
Guest
Posts: n/a
 
      1st Sep 2008
On 1 Sep., 14:54, Florian Paulus <florian.pau...@sc-cis.de> wrote:
> Snedker wrote:
> > On 1 Sep., 14:32, Snedker <Morten.Sned...@gmail.com> wrote:
> >> On 1 Sep., 14:14, Florian Paulus <florian.pau...@sc-cis.de> wrote:

>
> >>> Snedker wrote:
> >>>> As part of URL I have ie:
> >>>>www.website.com?test=%F8%E5%C6%D8%C5
> >>>> Requesting the querystring and displaying the content on web I just
> >>>> get a bunch of squares instead of the special Danish characters thatI
> >>>> expect. But I don't know how to decode them properly. Do you?
> >>>> Any help or pointer in the right direction is greatly appreciated -
> >>>> thanks in advance!
> >>>> Kind regards /Snedker
> >>> How are you trying to decode them?
> >> Using System.Web.SystemHttpUtility.UrlDecode is what I've tried, but
> >> not with the result of "squares"...

>
> >> Regards /Snedker

>
> > ..but WITH the result of squares, that is... :-)
> > /snedker

>
> Did you try to set the default encodings to utf-8 in your web.config?
>
> <configuration>
> * * <system.web>
> * * * *<globalization
> * * * * * requestEncoding="utf-8"
> * * * * * responseEncoding="utf-8" />
> * * </system.web>
> </configuration>- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -


Those exact settings are already set.

Thx for input and efforts!

Regards /Snedker
 
Reply With Quote
 
Snedker
Guest
Posts: n/a
 
      1st Sep 2008
On 1 Sep., 15:38, Snedker <Morten.Sned...@gmail.com> wrote:
> On 1 Sep., 14:54, Florian Paulus <florian.pau...@sc-cis.de> wrote:
>
>
>
>
>
> > Snedker wrote:
> > > On 1 Sep., 14:32, Snedker <Morten.Sned...@gmail.com> wrote:
> > >> On 1 Sep., 14:14, Florian Paulus <florian.pau...@sc-cis.de> wrote:

>
> > >>> Snedker wrote:
> > >>>> As part of URL I have ie:
> > >>>>www.website.com?test=%F8%E5%C6%D8%C5
> > >>>> Requesting the querystring and displaying the content on web I just
> > >>>> get a bunch of squares instead of the special Danish characters that I
> > >>>> expect. But I don't know how to decode them properly. Do you?
> > >>>> Any help or pointer in the right direction is greatly appreciated -
> > >>>> thanks in advance!
> > >>>> Kind regards /Snedker
> > >>> How are you trying to decode them?
> > >> Using System.Web.SystemHttpUtility.UrlDecode is what I've tried, but
> > >> not with the result of "squares"...

>
> > >> Regards /Snedker

>
> > > ..but WITH the result of squares, that is... :-)
> > > /snedker

>
> > Did you try to set the default encodings to utf-8 in your web.config?

>
> > <configuration>
> > * * <system.web>
> > * * * *<globalization
> > * * * * * requestEncoding="utf-8"
> > * * * * * responseEncoding="utf-8" />
> > * * </system.web>
> > </configuration>- Skjul tekst i anførselstegn -

>
> > - Vis tekst i anførselstegn -

>
> Those exact settings are already set.
>
> Thx for input and efforts!


Hope that last sentence wasn't read as "problem solved"... :-)

regards /snedker
 
Reply With Quote
 
Coskun SUNALI [MVP]
Guest
Posts: n/a
 
      1st Sep 2008
Hi Snedker,

Would you try System.Web.HttpUtility.UrlDecode?

--
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk

"Snedker" <(E-Mail Removed)> wrote in message
news:0f0653b6-4213-491c-889d-(E-Mail Removed)...
> On 1 Sep., 14:14, Florian Paulus <florian.pau...@sc-cis.de> wrote:
>> Snedker wrote:
>> > As part of URL I have ie:

>>
>> >www.website.com?test=%F8%E5%C6%D8%C5

>>
>> > Requesting the querystring and displaying the content on web I just
>> > get a bunch of squares instead of the special Danish characters that I
>> > expect. But I don't know how to decode them properly. Do you?

>>
>> > Any help or pointer in the right direction is greatly appreciated -
>> > thanks in advance!

>>
>> > Kind regards /Snedker

>>
>> How are you trying to decode them?

>
> Using System.Web.SystemHttpUtility.UrlDecode is what I've tried, but
> not with the result of "squares"...
>
> Regards /Snedker


 
Reply With Quote
 
Snedker
Guest
Posts: n/a
 
      1st Sep 2008
On 1 Sep., 16:43, "Coskun SUNALI [MVP]" <Cos...@SUNALI.com> wrote:
> Hi Snedker,
>
> Would you try System.Web.HttpUtility.UrlDecode?
>
> --
> All the best,
> Coskun SUNALI


Already tried that:

Dim s As String = HttpContext.Current.Request("test")
s = HttpUtility.UrlDecode(s, Encoding.UTF8)
s = HttpUtility.HtmlDecode(s)

and the s= lines in reverse order as well. Still no luck.

regards /Snedker
 
Reply With Quote
 
Florian Paulus
Guest
Posts: n/a
 
      2nd Sep 2008
Snedker wrote:
> On 1 Sep., 16:43, "Coskun SUNALI [MVP]" <Cos...@SUNALI.com> wrote:
>> Hi Snedker,
>>
>> Would you try System.Web.HttpUtility.UrlDecode?
>>
>> --
>> All the best,
>> Coskun SUNALI

>
> Already tried that:
>
> Dim s As String = HttpContext.Current.Request("test")
> s = HttpUtility.UrlDecode(s, Encoding.UTF8)
> s = HttpUtility.HtmlDecode(s)
>
> and the s= lines in reverse order as well. Still no luck.
>
> regards /Snedker


Are you using firefox ? I did some testing and found that i get the same
problems as you describe unless i set in firefox about:config the
encoding for outgoing request to use unicode to true, the default was false.

After this it works nicely, else seems that the real querystring is
autoconverted into some strange %u..... format and that results into
those squares.

Look at it in the debugger, then u see what i mean. Thats the problem
but i dont know how to solve it, you would somehow need to find out the
original encoding of the client sending the request and decode it
yourself. All the builtin methods like urldecode and so on fail with the
same unwanted result.

Using POST however instead of GET it seems to work without any problems.

Regards

Florian
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to decode this partially encoded string? John Dalberg Microsoft ASP .NET 2 8th Mar 2007 06:27 PM
How can I decode a string encoded into 8859-1 ? Olivier Microsoft Dot NET Framework 1 1st Dec 2004 06:22 PM
How to decode a string encoded into 8859-1 Olivier Microsoft Frontpage 1 1st Dec 2004 02:21 PM
decode base64 string Guoqi Zheng Microsoft ASP .NET 1 27th Sep 2004 07:37 AM
decode base64 string Guoqi Zheng Microsoft VB .NET 3 24th Sep 2004 08:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:37 PM.