Avatar of fmsol
fmsol
 asked on

Passing special characters in http get request

Have a webpage that is opened from another system with parameters that can contain extended ascii characters:

http://<host>/submitpage.cshtml?pname=SomeName

Open in new window

The cshtml webpage reads the parameters as usual with:

var pname = Request["pname"];
and shows it on the page with @pname

Works fine for all browsers except IE (even IE11) when pname=Günther or another name with foreign characters; ü, ø and so on.

Example:
http://<host>/submitpage.cshtml?pname=Günther

Open in new window

results in G�nther
The webpage is using <meta charset="UTF-8" />

Why does this work in Chrome and Opera but not in IE?
Any solution? I have no control over the submitting system, som the url cannot be encoded before submit.
ASPHTTP ProtocolC#ASP.NET

Avatar of undefined
Last Comment
Big Monty

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Big Monty

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Kanti Prasad

Hi Julian Hansen

Ok Thanks! I will put some notes around before I post any link.

Cheers
fmsol

ASKER
Thank you Big Monty,
but why isn't this a problem in Opera and Chrome? Only IE?

I can also solve it by using jQuery:
$(location).attr('search');

Open in new window

which returns the correct  string, but I thought it could be solved more easily with another codepage or something.
Big Monty

Because IE is a lot less forgiving than other browsers (older versions at least) because it doesn't always follow the same standards. Once Edge comes out, hopefully all of that goes away.
Your help has saved me hundreds of hours of internet surfing.
fblack61