Re: requestEncoding = "ISO-8859-1"
- From: Joerg Jooss <news-reply@xxxxxxxxxxxxx>
- Date: Tue, 7 Feb 2006 22:12:24 +0000 (UTC)
Thus wrote Mark,
I would love to remain with UTF-8 as well, but the scenario below
appears to require ISO-8859-x.
* Create a new web project with an .HTM page and a .ASPX page using
all the
defaults of VS.NET 2003.
* Put an HTML form on the HTM page. Send the results of the form
submission
to the .ASPX page.
* If the form includes any fun accents (Spanish names for example),
the
Request object on the .aspx page nukes them. The code below
illustrates
this.
* The client I'm using to test this is the latest patched version of
IE
(6.0.29.. SP2)
string Test1 = Request["FirstName"];
It was my understanding that UTF-8 should be all encompassing,
allowing for all of these other characters??? I'm very confused ...
Don't be. All that happens is that your HTML form likely doesn't specify any encoding, thus your browser assumes ISO-8859-1 by default (check your browser's encoding option after loading the form!).
HTML 4.01 even includes an attribute to specify the character encoding for a submitted web form ("accept-charset"), but last time I checked it was practically unsupported. What happens instead is that the original response encoding (ISO-8859-1 assumed if not specified) is used as subsequent request encoding.
Therefore, simply mark your static HTML as UTF-8 encoded as well (and of course encode them physically using UTF-8 as well!):
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
That should do the trick.
--
Joerg Jooss
news-reply@xxxxxxxxxxxxx
.
- Follow-Ups:
- Re: requestEncoding = "ISO-8859-1"
- From: Mark
- Re: requestEncoding = "ISO-8859-1"
- From: Juan T. Llibre
- Re: requestEncoding = "ISO-8859-1"
- References:
- Re: requestEncoding = "ISO-8859-1"
- From: Mark
- Re: requestEncoding = "ISO-8859-1"
- Prev by Date: Profile in ASP.Net 2 - How does it works?
- Next by Date: Re: Redirect with POST ?
- Previous by thread: Re: requestEncoding = "ISO-8859-1"
- Next by thread: Re: requestEncoding = "ISO-8859-1"
- Index(es):
Relevant Pages
|