bsuh / node_xslt

a simple XSLT addon for node
zlib License
71 stars 17 forks source link

readXmlString or other functions only accecpt UTF-8 encoding string. #17

Open peixinchen opened 11 years ago

peixinchen commented 11 years ago

Functions only take UTF-8 encoding string, so can't handler XML data like '<?xml version="1.0" encoding="GBK" ?>', i must iconv XML string to UTF-8 and change the XML header encoding to UTF-8, too terrible.

tcdaly commented 10 years ago

Is it true that only UTF8 strings are accepted? If so, I assume that only UTF8 strings are returned and any 'encoding' attributes that are set to anything other than 'UTF8' in stylesheets are ignored?

peixinchen commented 10 years ago

https://github.com/bsuh/node_xslt/blob/master/node_xslt.cc#LC70

ARG_utf8(str, 0) and htmlDocPtr doc = htmlReadFile( *str, "UTF-8", useErrors->BooleanValue() ? HTML_PARSE_RECOVER | HTML_PARSE_NOERROR : HTML_PARSE_RECOVER );

assume the argument str is utf-8.

Am i wrong?