1

we have an old asp intranet site with a search input field. Due to some changes, the searchapplication itself got redeveloped with asp.net and MVC4. So the old search form now for example submits to intranet/applications/search. And as long as I don't use the IE9 everybody is happy.

The problem occurs on german umlaute ä, ö, ü, ß etc. My visual studio debugger shows the following instead of the 2 umlaut:

umlaute encoding

The asp intranet site has a charset of:

<meta content="text/html; charset=iso-8859-2" http-equiv="Content-Type">

and the form has a accept-charset="UTF-8" attribute. Maybe I miss some knowledge about en-/decoding in html. But I couldn't find any answer so far.

Here are some more parameters from my controllers BeginExecute

enter image description here

csteinmueller
  • 2,427
  • 1
  • 21
  • 32
  • Your mis-matching your encoding which is why you end up with corrupted characters. If your [tag:asp-classic] page is encoded as `iso-8859-2` (28592) then your form also needs to post as `iso-8859-2`. I doubt IE9 is causing the issue it's more likely the other browsers are just masking the problem and 9 times out of 10 the characters will map from `iso-8859-2` to `UTF-8` without a problem, but this will not always be the case. Best to fix the root of the issue. – user692942 Apr 08 '14 at 11:10
  • If the form also posts iso-8859-2 the result is still the same. – csteinmueller Apr 08 '14 at 11:11
  • So if you post as `iso-8859-2` what does `httpContext` `ContentEncoding` look like, does it still say `System.Text.UTF8Encoding`? – user692942 Apr 08 '14 at 11:14
  • I recommend you have a look at [this answer](http://stackoverflow.com/a/21914278/692942) it explains in detail how to handle encoding in [tag:asp-classic] pages and how to avoid mis-matching encoding. – user692942 Apr 08 '14 at 11:26
  • @Lankymart : if I POST with iso-8859-2 the `ContentEncoding` property still shows `Text.UTF8Encoding`. I will take a look at the linked question/answer – csteinmueller Apr 08 '14 at 12:07

0 Answers0