forked from libxmljs/libxmljs
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
It would be nice if we could asynchroneously parse an XML document from a string literal. Document.fromXmlAsync isn't completely up to that task since it passes NULL as the encoding argument to its xmlReadMemory call, which presumably triggers auto-detection of file encoding. So it could be that some application has a string which originally got read from a non-UTF-8 file and therefore starts with a non-UTF-8 encoding in the xml header. But it's a string, and turning that into a Buffer will use UTF-8. Performing auto-detection on that buffer will likely lead to incorrect input.
This would be needed for albanm/node-libxslt#35.