ASCII Code

  • Thread starter Thread starter Andre
  • Start date Start date
A

Andre

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.
 
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.
 
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,
 
I receive a Querystring like this ;

"....errorMessage=%3CLI%3ENum%E9ro+de+carte+non+valide%3Cbr%3E%3CLI%3ELe+mois+d%27expiration+est+invalide%3Cbr%3E%3CLI%3ELe+nom+doit+%EAtre+moins+que+64+caract%E8res%3Cbr%3E%3CLI%3ECourriel+doit+%EAtre+moins+que+64+caract%E8res%3Cbr%3E%3CLI%3EAdresse+1+doit+%EAtre+moins+que+32+caract%E8res%3Cbr%3E%3CLI%3ELa+ville+doit+%EAtre+moins+que+32+caract%E8res%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"))
 
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" />
 
Thus wrote Andre,
I receive a Querystring like this ;

"....errorMessage=%3CLI%3ENum%E9ro+de+carte+non+valide%3Cbr%3E%3CLI%3E
Le+mois+d%27expiration+est+invalide%3Cbr%3E%3CLI%3ELe+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+%EAtre+moins+que+32+ca
ract%E8res%3Cbr%3E%3CLI%3ELa+ville+doit+%EAtre+moins+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,
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top