UrlEncode - UrlDecode problem: not symmetric

Discussion in 'ASP .Net' started by lookaround, Mar 14, 2007.

  1. lookaround

    lookaround Guest

    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!
     
    lookaround, Mar 14, 2007
    #1
    1. Advertising

  2. On Mar 14, 7:39 pm, "lookaround" <> 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
     
    Alexey Smirnov, Mar 15, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    4
    Views:
    10,302
    mikeb
    Jan 22, 2004
  2. John Hoge
    Replies:
    4
    Views:
    3,926
    John Hoge
    Jul 26, 2004
  3. Dario Sala
    Replies:
    1
    Views:
    3,805
    Karl Seguin
    Nov 15, 2004
  4. Lloyd Sheen

    Problem with Web.HttpUtility.UrlDecode

    Lloyd Sheen, Mar 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,774
    Lloyd Sheen
    Mar 2, 2005
  5. =?Utf-8?B?bWF2cmljazEwMQ==?=

    UrlDecode !!! retrieving querystring from an 'escaped' url

    =?Utf-8?B?bWF2cmljazEwMQ==?=, Apr 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,718
    =?Utf-8?B?bWF2cmljazEwMQ==?=
    Apr 22, 2005
Loading...

Share This Page