qore icon indicating copy to clipboard operation
qore copied to clipboard

module-yaml: parse_yaml probably assumes utf-8 encoding of the source string

Open tethal opened this issue 8 years ago • 1 comments

I did not confirm this with an actual example, but the implementation suggests it:

any parse_yaml(string yaml) [flags=RET_VALUE_ONLY] {
   QoreYamlParser parser(*yaml, xsink);
   return parser.parse();
}

DLLLOCAL QoreYamlParser(const QoreString &str, ExceptionSink *n_xsink) : QoreYamlBase(n_xsink), discard(false) {
   yaml_parser_initialize(&parser);
   yaml_parser_set_input_string(&parser, (const unsigned char *)str.getBuffer(), str.strlen());
   yaml_parser_set_encoding(&parser, YAML_UTF8_ENCODING);
   valid = true;
}

tethal avatar May 17 '16 09:05 tethal

This will be handled easily once the stream API #869 is done

tethal avatar May 30 '16 08:05 tethal