M
Mark
Assume you have a simple HTML form that submits its form results to a .aspx
page. The receiving .aspx page processes the values sent by the form. If
the form data contains an accented character (ex., Ángel with an accent over
"A"), the REQUEST object appears to loose the globalization, and nukes any
extended ascii characters. Is there a way to avoid this? In the examples
below, the resulting string is "ngel", without the A and accent.
Suggestions?
string myKey = "Name";
string Test0 = Request.Form.Get(myKey);
string Test1 = Request[myKey];
string Test2 = Request[myKey].ToString(CultureInfo.CurrentCulture);
string Test3 = Request[myKey].ToString(CultureInfo.InvariantCulture);
In the web.config, all the defaults remain including:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
For those of you wondering why we do this, we have non-technical staff
members that create HTML forms. They all redirect to a .NET application
that handles the routing/logging in a consistent way. However, it appears
to be dropping all extended ascii characters. Neat.
page. The receiving .aspx page processes the values sent by the form. If
the form data contains an accented character (ex., Ángel with an accent over
"A"), the REQUEST object appears to loose the globalization, and nukes any
extended ascii characters. Is there a way to avoid this? In the examples
below, the resulting string is "ngel", without the A and accent.
Suggestions?
string myKey = "Name";
string Test0 = Request.Form.Get(myKey);
string Test1 = Request[myKey];
string Test2 = Request[myKey].ToString(CultureInfo.CurrentCulture);
string Test3 = Request[myKey].ToString(CultureInfo.InvariantCulture);
In the web.config, all the defaults remain including:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
For those of you wondering why we do this, we have non-technical staff
members that create HTML forms. They all redirect to a .NET application
that handles the routing/logging in a consistent way. However, it appears
to be dropping all extended ascii characters. Neat.