Stack Exchange
Asp.Net Core 2.0 MVC app: return response in non-utf8 character encoding
I did the following:

Installed System.Text.Encoding.CodePages 4.4.0
In Startup.ConfigureServices() I have:
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

In CustomersController
public async Task<IActionResult> Register()
{
    ...

    return View();
}

Register.cshtml content like below:
@{
    Layout = null;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
    <META http-equiv="Content-Type" content="text/html;charset=shift_jis" />
</HEAD>
<BODY>
    <FORM action="https://some_external_web_app" method="post">
        <input type="hidden" name="customer_id" value="@ViewBag.CustomerId" />
        <input type="hidden" name="customer_name" value="@ViewBag.CustomerName" />
        ...
        <input type="submit" value="Start Registration" />
    </FORM>
</BODY>
</HTML>


Note that, view has meta tag with charset="shift_jis" (Japanase, code page 932) encoding.
The form will be posted to some external web app. That app refuses to accept posting because of incorrect character encoding. What should I do? I saved Register.cshtml in shift_jis encoding (VS2017 File, Save As, Save with Encoding, and selected shift_jis); didn't work.

I found this https://stackoverflow.com/q/153527/2698119
