DomDocument Factory that handles charset encoding.
You can create the DomDocument Object directly from the URL or from the HTML.
The class extract the encoding from the HTTP request, HTML header and format the HTML to be properly parsable by the DomDocument class.
Check the test file for example on how to use it.