Assembly: System.Web (in system.web.dll)
/** @property */ public Encoding get_HeaderEncoding () /** @property */ public void set_HeaderEncoding (Encoding value)
public function get HeaderEncoding () : Encoding public function set HeaderEncoding (value : Encoding)
Property ValueAn Encoding containing information regarding the character set for the current header.
The HeaderEncoding property gives you the ability to disable or change the Encoding object on a response header using either the ASCIIEncoding, UnicodeEncoding, UTF7Encoding, or UTF8Encoding object. The default encoding value is the T:System.Text.UTF8Encoding class.
Changing the type of the HeaderEncoding property potentially could invite certain malicious attacks or cause undesired data to be sent through the response header. Header injection attacks are avoided in part by leaving the HeaderEncoding property of a response to the default setting. An attack against a vulnerable application could echo back entrusted data as part of a response header. If the HeaderEncoding is disabled due to a requirement for continuation lines in a header or if any header is constructed based on the result of untrusted data, the header data should be validated prior to sending to the response stream.