473,396 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

UrlDecode

Hi,

I UrlEncode a value that I put in my querystring. This value originally
contains the character "č", which is UrlEncoded to "%E8". When I try
to read the value from the querystring, I find out that the character
now is "%u00c3%u00a8" in the querystring and thus does not urldecode to
the original character, which is a problem. My site is using CMS. Any
idea what is going on?

Thank you for any support,

Alex

Oct 24 '06 #1
10 5843
Hi Alex,

That character should be encoded to %c3%a8, not %E8. It should appear as
%c3%a8 in the query string.

Use the System.Web.HttpUtility.UrlEncode and UrlDecode methods.

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi,

I UrlEncode a value that I put in my querystring. This value originally
contains the character "č", which is UrlEncoded to "%E8". When I try
to read the value from the querystring, I find out that the character
now is "%u00c3%u00a8" in the querystring and thus does not urldecode to
the original character, which is a problem. My site is using CMS. Any
idea what is going on?

Thank you for any support,

Alex
Oct 24 '06 #2
Actually it does encode to %c3%a8 (I already use
HttpUtility.UrlEncode), I mixed things up writing %E8. Sorry my
mistake. But there is no mistake in my original problem tought ;) It
ends up as %u00c3%u00a8 which can be UrlDecoded correctly. Why the %u00
(I guess it means it is unicode encoding characters...)

Thanks,

Dave Sexton wrote:
Hi Alex,

That character should be encoded to %c3%a8, not %E8. It should appear as
%c3%a8 in the query string.

Use the System.Web.HttpUtility.UrlEncode and UrlDecode methods.

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi,

I UrlEncode a value that I put in my querystring. This value originally
contains the character "č", which is UrlEncoded to "%E8". When I try
to read the value from the querystring, I find out that the character
now is "%u00c3%u00a8" in the querystring and thus does not urldecode to
the original character, which is a problem. My site is using CMS. Any
idea what is going on?

Thank you for any support,

Alex
Oct 24 '06 #3
Hi Alex,

I can't reproduce your problem. When I supply a string containing the
specified character to HttpUtility.UrlEncode it returns "%c3%a8". When I pass
"%c3%a8" to HttpUtility.UrlDecode it returns the specified character.
(verified in 2.0)

Where are you getting "%u00c3%u00a8" from?

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
Actually it does encode to %c3%a8 (I already use
HttpUtility.UrlEncode), I mixed things up writing %E8. Sorry my
mistake. But there is no mistake in my original problem tought ;) It
ends up as %u00c3%u00a8 which can be UrlDecoded correctly. Why the %u00
(I guess it means it is unicode encoding characters...)

Thanks,

Dave Sexton wrote:
Hi Alex,

That character should be encoded to %c3%a8, not %E8. It should appear as
%c3%a8 in the query string.

Use the System.Web.HttpUtility.UrlEncode and UrlDecode methods.

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi,

I UrlEncode a value that I put in my querystring. This value originally
contains the character "č", which is UrlEncoded to "%E8". When I try
to read the value from the querystring, I find out that the character
now is "%u00c3%u00a8" in the querystring and thus does not urldecode to
the original character, which is a problem. My site is using CMS. Any
idea what is going on?

Thank you for any support,

Alex

Oct 24 '06 #4
I specified my site is using CMS. I think it comes from CMS. I am not
sure I understand how to decode the string I am getting... I'll try and
post to a CMS channel to see if anyone ever experienced something
similar.

Dave Sexton wrote:
Hi Alex,

I can't reproduce your problem. When I supply a string containing the
specified character to HttpUtility.UrlEncode it returns "%c3%a8". When Ipass
"%c3%a8" to HttpUtility.UrlDecode it returns the specified character.
(verified in 2.0)

Where are you getting "%u00c3%u00a8" from?

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
Actually it does encode to %c3%a8 (I already use
HttpUtility.UrlEncode), I mixed things up writing %E8. Sorry my
mistake. But there is no mistake in my original problem tought ;) It
ends up as %u00c3%u00a8 which can be UrlDecoded correctly. Why the %u00
(I guess it means it is unicode encoding characters...)

Thanks,

Dave Sexton wrote:
Hi Alex,

That character should be encoded to %c3%a8, not %E8. It should appear as
%c3%a8 in the query string.

Use the System.Web.HttpUtility.UrlEncode and UrlDecode methods.

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi,

I UrlEncode a value that I put in my querystring. This value originally
contains the character "č", which is UrlEncoded to "%E8". When I try
to read the value from the querystring, I find out that the character
now is "%u00c3%u00a8" in the querystring and thus does not urldecode to
the original character, which is a problem. My site is using CMS. Any
idea what is going on?

Thank you for any support,

Alex
Oct 24 '06 #5
Hi Alex,

That's a good idea.

GL

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
I specified my site is using CMS. I think it comes from CMS. I am not
sure I understand how to decode the string I am getting... I'll try and
post to a CMS channel to see if anyone ever experienced something
similar.

Dave Sexton wrote:
Hi Alex,

I can't reproduce your problem. When I supply a string containing the
specified character to HttpUtility.UrlEncode it returns "%c3%a8". When I
pass
"%c3%a8" to HttpUtility.UrlDecode it returns the specified character.
(verified in 2.0)

Where are you getting "%u00c3%u00a8" from?

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
Actually it does encode to %c3%a8 (I already use
HttpUtility.UrlEncode), I mixed things up writing %E8. Sorry my
mistake. But there is no mistake in my original problem tought ;) It
ends up as %u00c3%u00a8 which can be UrlDecoded correctly. Why the %u00
(I guess it means it is unicode encoding characters...)

Thanks,

Dave Sexton wrote:
Hi Alex,

That character should be encoded to %c3%a8, not %E8. It should appear as
%c3%a8 in the query string.

Use the System.Web.HttpUtility.UrlEncode and UrlDecode methods.

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi,

I UrlEncode a value that I put in my querystring. This value originally
contains the character "č", which is UrlEncoded to "%E8". When I try
to read the value from the querystring, I find out that the character
now is "%u00c3%u00a8" in the querystring and thus does not urldecode to
the original character, which is a problem. My site is using CMS. Any
idea what is going on?

Thank you for any support,

Alex

Oct 24 '06 #6
Anyhow, thanks for your answers!

Dave Sexton wrote:
Hi Alex,

That's a good idea.

GL

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
I specified my site is using CMS. I think it comes from CMS. I am not
sure I understand how to decode the string I am getting... I'll try and
post to a CMS channel to see if anyone ever experienced something
similar.

Dave Sexton wrote:
Hi Alex,

I can't reproduce your problem. When I supply a string containing the
specified character to HttpUtility.UrlEncode it returns "%c3%a8". WhenI
pass
"%c3%a8" to HttpUtility.UrlDecode it returns the specified character.
(verified in 2.0)

Where are you getting "%u00c3%u00a8" from?

--
Dave Sexton

"Alex" <as******@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
Actually it does encode to %c3%a8 (I already use
HttpUtility.UrlEncode), I mixed things up writing %E8. Sorry my
mistake. But there is no mistake in my original problem tought ;) It
ends up as %u00c3%u00a8 which can be UrlDecoded correctly. Why the %u00
(I guess it means it is unicode encoding characters...)

Thanks,

Dave Sexton wrote:
Hi Alex,
>
That character should be encoded to %c3%a8, not %E8. It should appear as
%c3%a8 in the query string.
>
Use the System.Web.HttpUtility.UrlEncode and UrlDecode methods.
>
--
Dave Sexton
>
"Alex" <as******@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi,
>
I UrlEncode a value that I put in my querystring. This value originally
contains the character "č", which is UrlEncoded to "%E8". When I try
to read the value from the querystring, I find out that the character
now is "%u00c3%u00a8" in the querystring and thus does not urldecode to
the original character, which is a problem. My site is using CMS. Any
idea what is going on?
>
Thank you for any support,
>
Alex
Oct 24 '06 #7
Thus wrote Dave,
Hi Alex,

That character should be encoded to %c3%a8, not %E8. It should appear
as %c3%a8 in the query string.
There is no "should", since there is no defined character encoding for ULR
encoding -- it can be anything sender and receiver understand.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Oct 24 '06 #8
Hi Joerg,

That is certainly true, however neither "%E8" nor "%u00c3%u00a8" are returned
using HttpUtility.UrlEncode, even when specifying any of the FCL Encodings.
It should, by default, be "%c3%a8".

--
Dave Sexton

"Joerg Jooss" <ne********@joergjooss.dewrote in message
news:b1**************************@msnews.microsoft .com...
Thus wrote Dave,
>Hi Alex,

That character should be encoded to %c3%a8, not %E8. It should appear
as %c3%a8 in the query string.

There is no "should", since there is no defined character encoding for ULR
encoding -- it can be anything sender and receiver understand.
Cheers,
--
Joerg Jooss
ne********@joergjooss.de


Oct 24 '06 #9
Thus wrote Dave,
Hi Joerg,

That is certainly true, however neither "%E8" nor "%u00c3%u00a8" are
returned using HttpUtility.UrlEncode, even when specifying any of the
FCL Encodings.
Then you're doing something wrong ;-)

string s = HttpUtility.UrlEncode("č", Encoding.GetEncoding(28591));
Console.WriteLine(s);

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Oct 24 '06 #10
Hi Joerg,

The OP didn't specify any encoding and so I assumed that UrlEncode was being
used without any explicit encoding specified - my mistake.

I didn't mean to imply that it's not possible for UrlEncode to return "%e8", I
simply meant that you can't get it using the "FCL encodings", such as ASCII,
UTF8, UTF7, UTF32, Unicode and BigEndianUnicode or by not specifying any
encoding at all, because that's what I tested originally. I was just trying
to explain the intent for my original response :)

To answer the OP's question, I iterated over every encoding returned by
Encoding.GetEncodings looking for one that converts the specified character to
"%u00c3%u00a8". 28591 does convert the character to %e8, just like Western
European (Windows) - 1252 (Encoding.Default for me), and a few others, but
that isn't the problem at hand. The OP needs to decode "%u00c3%u00a8" but at
this point it doesn't seem like a valid encoding that can be produced by the
framework.

--
Dave Sexton

"Joerg Jooss" <ne********@joergjooss.dewrote in message
news:b1**************************@msnews.microsoft .com...
Thus wrote Dave,
>Hi Joerg,

That is certainly true, however neither "%E8" nor "%u00c3%u00a8" are
returned using HttpUtility.UrlEncode, even when specifying any of the
FCL Encodings.

Then you're doing something wrong ;-)

string s = HttpUtility.UrlEncode("č", Encoding.GetEncoding(28591));
Console.WriteLine(s);

Cheers, --
Joerg Jooss
ne********@joergjooss.de


Oct 24 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Thomas Henz | last post by:
Hi again, can anyone tell me why it says that the object doesnt support this method? rs is a db query resultset. msg is a db field with urlencoded data in it. ------------ if not rs.eof then...
0
by: Yifan | last post by:
Hi I want to use UrlDecode() in C++. I have a Win32 Visual C++ (.NET) project #using <mscorlib.dll #using <System.dll #using <System.Web.dll using namespace System using namespace...
1
by: Joćo Santa Bįrbara | last post by:
hi all is there any replace for the System.Web.HttpUtility.UrlDecode to windows forms ... thks JSB
5
by: Yifan | last post by:
Hi I want to use UrlDecode() in C++. I have a Visual C++ (.NET) Win32 project #using <mscorlib.dll #using <System.dll #using <System.Web.dll using namespace System using namespace...
4
by: John Hoge | last post by:
Hi, I need to UrlDecode a string in a simple console application, but I am having trouble accessing Server.UrlDecode, even though System.Web is included. The application pulls a text out of a...
6
by: John Grandy | last post by:
Does Server.URLDecode() need to be applied to Request.QueryString(<key name>) ?
1
by: fjm67 | last post by:
I see Google edited my email address. Lets try this. captonline at yahoo dot com Can you guys help me out please? I need to implement urldecode into a php script and don't know how. Here is...
20
by: gert | last post by:
This based on a example i found at http://www.cs.tut.fi/~jkorpela/ forms/cgic.html #include <fcgi_stdio.h> #include <stdlib.h> int urldecode(char *src, char *last, char *dest){ int code;...
3
by: gert | last post by:
Anybody can tell me what i need to import to make urlDecode() work in python2.5 please. import urllib urllib.urlDecode(post) #doesn't exist urllib.urldecode(post) #doesn't exist...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.