473,385 Members | 1,834 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,385 software developers and data experts.

URL encoded text automatically decoded?

Hello group. I'm passing URL encoded text (actually HTML) via querystring
to a webform. Part of the encoded text looks like:

... %3Cfont%20color%3D%22yellow%22%20size%3D%227%22%3E ..

However, when I put a breakpoint in my code behind and check the value of
the querystring value (Request.QueryString("text")), it shows up already
decoded. So the above text in the immediate window shows up as:

... <font color="yellow" size="7"> ..

I originally planned on using Server.URLDecode, but it seems as though .NET
is automatically decoding the HTML -- is this correct OR do I still need to
use URLDecode?

Any insights / explanations are very welcome!
Ben
Nov 19 '05 #1
4 2912
To test this you should write a little loop which outputs the string to the
Output window.

Debug.write . . . .

And write character by character, this way you can be sure.


"Ben Amada" <be*@REpoMOweVErpick.com> wrote in message
news:u9***************@TK2MSFTNGP15.phx.gbl...
Hello group. I'm passing URL encoded text (actually HTML) via querystring
to a webform. Part of the encoded text looks like:

.. %3Cfont%20color%3D%22yellow%22%20size%3D%227%22%3E ..

However, when I put a breakpoint in my code behind and check the value of
the querystring value (Request.QueryString("text")), it shows up already
decoded. So the above text in the immediate window shows up as:

.. <font color="yellow" size="7"> ..

I originally planned on using Server.URLDecode, but it seems as though
.NET is automatically decoding the HTML -- is this correct OR do I still
need to use URLDecode?

Any insights / explanations are very welcome!
Ben

Nov 19 '05 #2
Mr Newbie wrote:
To test this you should write a little loop which outputs the string to
the Output window.

Debug.write . . . .

And write character by character, this way you can be sure.


I'll give that a try and see what happens -- thanks!

Ben
Nov 19 '05 #3
Mr Newbie wrote:
To test this you should write a little loop which outputs the string to
the Output window.

Debug.write . . . .

And write character by character, this way you can be sure.


Hello again,

I tested this out and found when I check each character within
Request.QueryString("text"), the HTML is showing up as decoded. Looking at
the querystring value in the address bar of the browser, it is encoded. I
guess it doesn't hurt that .NET is automatically decoding the HTML, but I
was just thrown as I didn't expect this automatic decoding to take place.

Thanks,
Ben
Nov 19 '05 #4
It makes sense really.

Glad you diagnosed it though, nothing better than proof provided by self !

Regards Mr N . . .
"Ben Amada" <be*@REpoMOweVErpick.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
Mr Newbie wrote:
To test this you should write a little loop which outputs the string to
the Output window.

Debug.write . . . .

And write character by character, this way you can be sure.


Hello again,

I tested this out and found when I check each character within
Request.QueryString("text"), the HTML is showing up as decoded. Looking
at the querystring value in the address bar of the browser, it is encoded.
I guess it doesn't hurt that .NET is automatically decoding the HTML, but
I was just thrown as I didn't expect this automatic decoding to take
place.

Thanks,
Ben

Nov 19 '05 #5

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

Similar topics

2
by: David Stockwell | last post by:
snippet payload = {} try: message = email.message_from_string(message) messageHeader = dict(message._headers) addressFrom = messageHeader addressReply = messageHeader.get("Reply-To")...
3
by: Supratim | last post by:
Hi, For past few weeks I am working on a function that would take encoded Unicode characters from query string of http requests and then decode them back to Unicode numbers. I have full success...
8
by: Eric Lilja | last post by:
Hello, I had what I thought was normal text-file and I needed to locate a string matching a certain pattern in that file and, if found, replace that string. I thought this would be simple but I had...
5
by: Mike Murray | last post by:
Hi I have the following issue. I have a character that is return by a SQL Server database "É" to be precise, the issue is that when I store character in a .net string variable my understanding...
3
by: Sandra-24 | last post by:
I'd love to know why calling ''.join() on a list of encoded strings automatically results in converting to the default encoding. First of all, it's undocumented, so If I didn't have non-ascii...
2
by: Magnus | last post by:
I'm currently developing an application with classified information as input to a couple of algorithms. Which strategy should I use to protect the input data from beeing read? The files should...
4
by: micahc | last post by:
I currently have a Python program that reads in emails from a POP3 server. As soon as the message is read in it is fed directly into a PostgreSQL database for storage. Later, it is broken down...
2
by: mistral | last post by:
what code encoded in this snippet? <script language=JavaScript>function dc(x){var...
5
by: sniipe | last post by:
Hi, I have a problem with unicode string in Pylons templates(Mako). I will print first char from my string encoded in UTF-8 and urllib.quote(), for example string '£ukasz': ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.