libxml2-wasm
libxml2-wasm copied to clipboard
Support encoding parameter in parse functions
XmlDocument.fromStringshould encode the XML string using the specified encoding, or UTF-8 if none is provided.XmlDocument.fromBuffershould pass the encoding parameter to the Libxml2 functions. The caller is responsible for providing the correct encoding, or relying on Libxml2’s automatic detection.
Javascript/Node.JS have very limited encoding support OOB. Converting between arbitrary encodings needs 3rd party libraries. It would be better to require the caller to do the encode conversion when it is necessary before calling libxml2-wasm.