-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
As discussed in Issue #136, SimpleBrowser currently only sets the page encoding if the character set is specified in the Content-Type HTTP header. If the Content-Type HTTP header specifies the character set, this is the correct behavior and this value should be used. If it is not set in the Content-Type HTTP header, the character set may be specified in HTML:
HTML 4.01: <meta http-equiv="content-type" content="text/html; charset=UTF-8">
HTML5: <meta charset="UTF-8">
XHTML: <?xml version="1.0" encoding="utf-8"?>
See the HTML5 Specification on this topic:
http://www.w3.org/TR/html5/document-metadata.html#character-encoding-declaration
Notes:
- Implementing this change will require pre-processing (parsing) the first 1K of the received HTML. To improve performance, this code should NOT be executed if the Content-Type specifies the content type.
- Pre-parsing HTML to determine the character set should not change how parsing the main HTML content works. Currently, HTML is not parsed until the first call to Find(). This is desirable behavior.
Metadata
Metadata
Assignees
Labels
No labels