Request.Querystring does not return extended characters

N

Navanith

Hi,

I wrote a simple aspx page that dumps query string to the
browser.
Following is the globalization section in web.config
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>

Here is the problem:-
If I manually type URL (IE 6.0) with spanish characters
in query string, Request.Querystring method is ignorning
all spanish characters. How can I make
Request.Querystring to return all the characters?

If I pass same spanish characeters using javascript i.e.,
document.location.search = .... Request.Querystring works
fine.

Environment: W2K Server, .NET 1.1

Any help is appreciated

Thank you
Nav
 
S

Steve C. Orr [MVP, MCSD]

Have you tried setting it to use unicode?
Here's more info on the subject:
http://msdn.microsoft.com/library/d...en-us/cpguide/html/cpconencodingbasetypes.asp

Also, you might adjust the Globalization section of your web.config.
Try changing it to something more like this:

<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
<globalization
fileEncoding="iso-8859-1"
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
/>
</system.web>
</configuration>
 
N

Navanith

Please see my comments below
-----Original Message-----
Have you tried setting it to use unicode?
Where should I try setting to unicode?. I did in
web.config and I also have a meta tag in the HTML page
with charset set to utf-8
Here's more info on the subject:
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/cpguide/html/cpconencodingbasetypes.asp
I read this article, in my case by the time query string
reaches the server extended characters are lost.
Also, you might adjust the Globalization section of your web.config.
Try changing it to something more like this:

<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
<globalization
fileEncoding="iso-8859-1"
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
/>
</system.web>
</configuration>
I tried setting requestEncoding and responseEncoding as
you said and it worked fine. But changing from unicode to
iso-8859-1 is not an acceptable solution because we need
to support multiple languages (including double byte)
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top