Skip to content

Asynchroneous parse from string  #4

@gagern

Description

@gagern

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions