Request.Querystring does not return extended characters

  • Thread starter Thread starter Navanith
  • Start date Start date
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
 
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>
 
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)
 
Back
Top