But the problem starts when the cookie contains special/foreign characters.
After invoking UrlDecode it will drop all special/foreign characters and
displays only the rest of the string. I tried not to use UrlDecode to see if
the characters get lost before invoking UrlDecode but they are still there.
Also other (classsic) ASP pages have no problem reading cookies with
special/foreign characters and displaying them correctly.
I even tried to take encoded string with special/foreign characters, used
UrlDecode directly on this string (not reading from cookie) and it still
displays it incorrectly so I think the problem is somewhere with UrlDecode
method.
I tried this
response.write
(Server.UrlDecode("%2D%2D%EC%9A%E8%F8%9E%FD%E1%ED%E9%2A%2A"))
and it displays this
--**
instead of
--escrzЩАМИ** (see the attached picture to see the characters if this
doesn't display properly)
Is it a bug or is a feature in UrlDecode ? If it is a feature is there a
solution how to display all characters correctly?
Thanks a lot
JD
I think this has to do with the character set used in the original string.
You might want to try the HttpUtility.UrlDecode() method which supports a
character encoding parameter. I suspect the base version is dealing with
ASCII encoding whcih wouldn't show the extended chars...
+++ Rick ---
--
Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web
"JD" <skl...@hotmail.com> wrote in message
news:uBxJZqwc...@TK2MSFTNGP09.phx.gbl...
for anyone who strugles with a similar problem I used:
HttpUtility.UrlDecode(request.cookies("somecookie").values("somevalue"),Syst
em.Text.Encoding.Default)
I tried other encodings (UTF8) but it didn't seem to work, Default on the
other hand works perfectly.
Thanks a lot for your help Rick.
Have a nice day.
JD
"Rick Strahl [MVP]" <ricks...@hotmail.com> wrote in message
news:#szTl7wc...@TK2MSFTNGP10.phx.gbl...