This documentation is archived and is not being maintained.

HttpRequest.ContentEncoding Property

Gets or sets the character set of the entity-body.

[Visual Basic]
Public Property ContentEncoding As Encoding
public Encoding ContentEncoding {get; set;}
public: __property Encoding* get_ContentEncoding();
public: __property void set_ContentEncoding(Encoding*);
public function get ContentEncoding() : Encoding;
public function set ContentEncoding(Encoding);

Property Value

An Encoding object representing the client's character set.


Default ContentEncoding can be specified in an ASP.NET configuration file in the <globalization> Element section. If ContentEncoding is specified by the client, the default configuration settings are overridden.


The following example assigns a value representing the description of the current HTTP Encoding to a string variable.

[Visual Basic] 
Dim EncodingType As String
 EncodingType = Request.ContentEncoding.EncodingName

String EncodingType;
 EncodingType = Request.ContentEncoding.EncodingName;

String* EncodingType;
 EncodingType = Request->ContentEncoding->EncodingName;

var encodingType : String = Request.ContentEncoding.EncodingName


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpRequest Class | HttpRequest Members | System.Web Namespace