|
|
How Do I...Handle Multiple Encodings in one ASP.NET page?This sample illustrates how to use ContentEncoding property provided in the HttpWebResponse class and how to create a proper Encoding object from the property value. This enables your application to handle multiple encodings on the same page. The ContentEncoding property has the value of the character set in the ContentType HTTP header sent from ASP.NET. The GetEncoding() method of the System.Text.Encoding class accepts the encoding name string for creating the object.
Dim result As HttpWebResponse = req.GetResponse() ... Dim encode As Encoding = Encoding.GetEncoding( result.CharacterSet ) VB
Example
|