UrlEncode - UrlDecode problem: not symmetric

  • Thread starter Thread starter lookaround
  • Start date Start date
L

lookaround

Hi,
I have a problem with UrlEncoding/UrlDecoding.

I have two chars (æ±äº¬);
the HTTPUtility.UrlEncode writes in the html the text:
%e6%9d%b1%e4%ba%ac

The Request.Querystring.ToString() of the called page returns:
%u00e6%u009d%u00b1%u00e4%u00ba%u00ac

and after having UrlDecoded I obtain the text
æÂ񄧪

I don't know what's the problem... How should I do to obtain the
original text using UrlEncode and Decode?


I've posted the problem on asp.net forums too but didn't finad any
solution...
Thank you very much in advance for any idea!
 
Hi,
    I have a problem with UrlEncoding/UrlDecoding.

I have two chars (æ±äº¬);
the HTTPUtility.UrlEncode writes in the html the text:
%e6%9d%b1%e4%ba%ac

The Request.Querystring.ToString() of the called page returns:
%u00e6%u009d%u00b1%u00e4%u00ba%u00ac

and after having UrlDecoded I obtain the text
 æÂ񄧪

I don't know what's the problem... How should I do to obtain the
original text using UrlEncode and Decode?

I've posted the problem on asp.net forums too but didn't finad any
solution...
Thank you very much in advance for any idea!

It is symmetric.

Response.Write(
System.Web.HttpUtility.UrlDecode(
System.Web.HttpUtility.UrlEncode(
"æ±äº¬")));

Output: æ±äº¬

It looks like you encode or decode the string more than one time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top