libxml2-wasm icon indicating copy to clipboard operation
libxml2-wasm copied to clipboard

Support encoding parameter in parse functions

Open jameslan opened this issue 2 months ago • 1 comments

  • XmlDocument.fromString should encode the XML string using the specified encoding, or UTF-8 if none is provided.
  • XmlDocument.fromBuffer should pass the encoding parameter to the Libxml2 functions. The caller is responsible for providing the correct encoding, or relying on Libxml2’s automatic detection.

jameslan avatar Nov 05 '25 07:11 jameslan

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.

jameslan avatar Nov 25 '25 06:11 jameslan