I am working on a very large corporate project. It is a C#, .NET Entity Framework site with a Microsoft SQL server behind it.
The input I am testing is inside a form like so:
@using (Html.BeginForm("CreateAgency", "Agency", FormMethod.Post, new { enctype = "multipart/form-data", accept_charset = "utf-8" }))
{
...
<li>
<label id="lblAgency" class="AgencyEditorPanelItemsLabel">Agency Name</label>
@Html.TextBoxFor(m => m.AgencyName, new { @class="newAgencyTextInput"})
</li>
...
This goes back to an AgencyController where it gets parsed:
NameValueCollection nvc = HttpUtility.ParseQueryString(String.Empty);
nvc.Add("AgencyName", agency.AgencyName);
...
Then it gets packed into a string for posting through an API:
//make the post object readily convertable to a string
StringBuilder sb = new StringBuilder();
sb.Append(nvc.ToString());
//encode collection for pending transmission
var data = Encoding.UTF8.GetBytes(sb.ToString());
Is there anything in the code that I have shown that would cause UTF-8 characters to get turned into "%u00a5 %u00b7 %u00a3 %u00b7 %u20ac %u00b7 $ %u00b7 %u00a2 %u00b7 %u20a1 %u00b7 %u20a2 %u00b7 %u20a3 "? I've tried even adding a globalization key to my webconfig like so:
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" />
But that did nothing. Does anyone have some tips or ideas of things I could try to fix this problem?
Thank you very much for any help!