Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > UrlEncode - UrlDecode problem: not symmetric

Reply
Thread Tools

UrlEncode - UrlDecode problem: not symmetric

 
 
lookaround
Guest
Posts: n/a
 
      03-14-2007
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!

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-15-2007
On Mar 14, 7:39*pm, "lookaround" <lookaro...@virgilio.it> wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
=== is not a symmetric operator? Ralph Shnelvar Ruby 4 08-23-2010 03:26 PM
Problem with Web.HttpUtility.UrlDecode Lloyd Sheen ASP .Net 2 03-02-2005 10:27 AM
asp server.UrlEncode VS asp.net Server.UrlEncode Vs Php urlencode Dario Sala ASP .Net 1 11-15-2004 11:27 PM
Server.UrlDecode from console application John Hoge ASP .Net 4 07-26-2004 02:39 PM
Difference between System.Web.HttpUtility.UrlEncode and Server.UrlEncode? Andreas Klemt ASP .Net 4 01-22-2004 01:35 AM



Advertisments