Problem with special characters in Request Params

M

Mikael Engdahl

Hi,

I have a situation on an ASP.NET page on which I do a simple
Response.Write(Request.Params["x"]).

The problem is that when the parameters include special characters like
ä or é they are removed. For example, the string 'aéx' becomes 'ax'.

It is the same for both GET or POST and the problem is not in
Response.Write becuse the same thing happens if I use the string in a
database call.

What is wrong?

/Mikael
 
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>
 
M

Matt Berther

Hello Mikael,
The problem is that when the parameters include special characters
like ä or é they are removed. For example, the string 'aéx' becomes
'ax'.

Are you doing a Server.UrlEncode to the parameter values prior to appending them to the querystring?
 

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

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top