HttpRequest.ContentEncoding Property

Definition

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

C#
public System.Text.Encoding ContentEncoding { get; set; }

Property Value

An Encoding object representing the client's character set.

Examples

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

C#
String EncodingType;
 EncodingType = Request.ContentEncoding.EncodingName;

Remarks

Default content encoding can be specified in the globalization Element (ASP.NET Settings Schema) of a configuration file. If content encoding is also specified by the client, the default configuration settings are overridden.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1