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

ASCII Code

Hi,

What can i do to display ASCII code like %A0, %D9, etc.. that i retrieve
in a Querystring ?

I tried server.urlencode, but it does'nt seem to work.

Any idea ?

Thank you.
Mar 1 '06 #1
8 2569
its Server.UrlDecode that i used...
"Andre" <we*******@cablevision.qc.ca> a écrit dans le message de news:
eu**************@TK2MSFTNGP14.phx.gbl...
Hi,

What can i do to display ASCII code like %A0, %D9, etc.. that i
retrieve in a Querystring ?

I tried server.urlencode, but it does'nt seem to work.

Any idea ?

Thank you.

Mar 1 '06 #2
Instead of replacing the code with the appropriate Letter, the page write
nothing.

So if i have h%65llo, on the screen i will see hllo.
"Andre" <we*******@cablevision.qc.ca> a écrit dans le message de news:
eu**************@TK2MSFTNGP14.phx.gbl...
Hi,

What can i do to display ASCII code like %A0, %D9, etc.. that i
retrieve in a Querystring ?

I tried server.urlencode, but it does'nt seem to work.

Any idea ?

Thank you.

Mar 1 '06 #3
Thus wrote Andre,
Hi,

What can i do to display ASCII code like %A0, %D9, etc.. that i
retrieve in a Querystring ?


So you want to display a query string in its original URL encoded form? Use
HttpUtility.UrlEncode().

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 1 '06 #4
Post the code you have so far...

"Andre" <we*******@cablevision.qc.ca> wrote in message
news:eu**************@TK2MSFTNGP14.phx.gbl...
Hi,

What can i do to display ASCII code like %A0, %D9, etc.. that i
retrieve in a Querystring ?

I tried server.urlencode, but it does'nt seem to work.

Any idea ?

Thank you.

Mar 1 '06 #5
Dim TestString As String = "This is a <Test String>."
Dim EncodedString As String = Server.URLEncode(TestString)
Label1.Text = EncodedString


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Andre" <we*******@cablevision.qc.ca> wrote in message news:eu**************@TK2MSFTNGP14.phx.gbl...
Hi,

What can i do to display ASCII code like %A0, %D9, etc.. that i retrieve in a Querystring ?

I tried server.urlencode, but it does'nt seem to work.

Any idea ?

Thank you.

Mar 1 '06 #6
I receive a Querystring like this ;

"....errorMessage=%3CLI%3ENum%E9ro+de+carte+non+va lide%3Cbr%3E%3CLI%3ELe+mois+d%27expiration+est+inv alide%3Cbr%3E%3CLI%3ELe+nom+doit+%EAtre+moins+que+ 64+caract%E8res%3Cbr%3E%3CLI%3ECourriel+doit+%EAtr e+moins+que+64+caract%E8res%3Cbr%3E%3CLI%3EAdresse +1+doit+%EAtre+moins+que+32+caract%E8res%3Cbr%3E%3 CLI%3ELa+ville+doit+%EAtre+moins+que+32+caract%E8r es%3Cbr%3E%3CLI%3ELe+mois+d%27expiration+de+carte+ doit+%EAtre+num%E9rique%3Cbr%3E....."

The querystring i receive contain french word with some (é, è, à), using
code like (%E9 for é).. and these letter does'nt appear when i display the
message with these two test.

errorMessage.text = request.querystring("errorMessage")
errorMessage.text =
Server.URLEncode(request.querystring("errorMessage "))


"Joerg Jooss" <ne********@joergjooss.de> a écrit dans le message de news:
94**************************@msnews.microsoft.com...
Thus wrote Andre,
Hi,

What can i do to display ASCII code like %A0, %D9, etc.. that i
retrieve in a Querystring ?


So you want to display a query string in its original URL encoded form?
Use HttpUtility.UrlEncode().

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

Mar 2 '06 #7
Problem Solved.

I change UTF-8 in my Web.Config with this, and everything's fine :

<globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1" />


"Andre" <we*******@cablevision.qc.ca> a écrit dans le message de news:
eu**************@TK2MSFTNGP14.phx.gbl...
Hi,

What can i do to display ASCII code like %A0, %D9, etc.. that i
retrieve in a Querystring ?

I tried server.urlencode, but it does'nt seem to work.

Any idea ?

Thank you.

Mar 2 '06 #8
Thus wrote Andre,
I receive a Querystring like this ;

"....errorMessage=%3CLI%3ENum%E9ro+de+carte+non+va lide%3Cbr%3E%3CLI%3E
Le+mois+d%27expiration+est+invalide%3Cbr%3E%3CLI%3 ELe+nom+doit+%EAtre+
moins+que+64+caract%E8res%3Cbr%3E%3CLI%3ECourriel+ doit+%EAtre+moins+qu
e+64+caract%E8res%3Cbr%3E%3CLI%3EAdresse+1+doit+%E Atre+moins+que+32+ca
ract%E8res%3Cbr%3E%3CLI%3ELa+ville+doit+%EAtre+moi ns+que+32+caract%E8r
es%3Cbr%3E%3CLI%3ELe+mois+d%27expiration+de+carte+ doit+%EAtre+num%E9ri
que%3Cbr%3E....."

The querystring i receive contain french word with some (é, è, à),
using code like (%E9 for é).. and these letter does'nt appear when i
display the message with these two test.


The problem is quite likey that your application is using UTF-8 as request
encoding, but you receive ISO-8859-1 or -15.

Either change the requestEncoding attribute in web.config to one of encodings
mentioned above, or (better) change the client to use UTF-8. I guess the
page from which you receive that query string is not an ASP.NET page in your
app?

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 2 '06 #9

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

Similar topics

2
by: Martín Marconcini | last post by:
Hello there, I'm writting (or trying to) a Console Application in C#. I has to be console. I remember back in the old days of Cobol (Unisys), Clipper and even Basic, I used to use a program...
11
by: Kai Bohli | last post by:
Hi all ! I need to translate a string to Ascii and return a string again. The code below dosen't work for Ascii (Superset) codes above 127. Any help are greatly appreciated. protected...
18
by: Ger | last post by:
I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found...
399
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or...
9
by: =?Utf-8?B?RGFu?= | last post by:
I have the following code section that I thought would strip out all the non-ascii characters from a string after decoding it. Unfortunately the non-ascii characters are still in the string....
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.