asp URLEncode to aspx

S

Sharon

Hi all.
Url encoding a string on asp page and url decoding the string on aspx page,
non English characters are lost.
Encoding and decoding on the same page, asp or aspx, works fine.
Any idea?
Thanks.
Sharon.
 
S

Sharon

I don't understand exactly why, but saving the asp page as utf-8 did the
trick.
Sharon.
 
J

Joerg Jooss

Sharon said:
I don't understand exactly why, but saving the asp page as utf-8 did
the trick.
Sharon.

That's because ASP.NET expects non-ASCII characters contained in query
strings to be UTF-8 encoded by default, whereas ASP used some 8 bit
encoding like Latin 1.

Cheers,
 
S

Sharon

Thanks for the explanation.
When requesting a query field it is automatically url decoded,
and the result string is missing data.
Is there a way to convert it to utf-8?
Sharon.
 
J

Joerg Jooss

Sharon said:
Thanks for the explanation.
When requesting a query field it is automatically url decoded,
and the result string is missing data.
Is there a way to convert it to utf-8?
Sharon.

Sharon,

if the strings contained in Request.QueryString are missing characters,
the client was using a different encoding (non-recognized byte
sequences are simply dropped).

Either change the client's encoding (didn't you do that already
successfully?) or change the encoding used by ASP.NET (at least
requestEncoding in web.config).

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top