[ACCEPTED]-context.Response.Charset = Encoding.UTF8.ToString();-character-encoding
Accepted answer
Context.Response.Charset = Encoding.UTF8.WebName;
Gets the name registered with the Internet 2 Assigned Numbers Authority (IANA) for the 1 current encoding.
Encoding.UTF8.ToString();
doesn't return
"utf-8"
It returns
"System.Text.UTF8Encoding"
which is the name 5 of the type that Encoding.UTF8 lives in.
The 4 name of the type (or class definition) is 3 always returned by Object.ToString() if 2 there is no overriding method in the class 1 (which is the case here).
use Encoding.UTF8.WebName to get the value 1 to be used in the charset.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.