| Class | HTML5::HTMLInputStream |
| In: |
lib/html5/inputstream.rb
|
| Parent: | Object |
This class takes care of character encoding and removing or replacing incorrect byte-sequences and also provides column and line tracking.
| char_encoding | [RW] | |
| errors | [RW] | |
| queue | [RW] |
Initialises the HTMLInputStream.
HTMLInputStream(source, [encoding]) -> Normalized stream from source for use by the HTML5Lib.
source can be either a file-object, local filename or a string.
The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element)
parseMeta - Look for a <meta> element containing encoding information
Returns a string of characters from the stream up to but not including any character in characters or EOF. characters can be any container that supports the in method being called on it.
Attempts to detect at BOM at the start of the stream. If an encoding can be determined from the BOM return the name of the encoding otherwise return nil