void t07_codecs_html(){ INIT_LOCAL(); char *encoded=onion_html_quote("<\"Hello\">"); FAIL_IF_NOT_EQUAL_STR( encoded, "<"Hello">"); free(encoded); END_LOCAL(); }
/** * @short Writes the given string to the res, but encodes the data using html entities * @ingroup response * * The encoding mens that <code><html> whould become <html></code> */ ssize_t onion_response_write_html_safe(onion_response * res, const char *data) { char *tmp = onion_html_quote(data); if (tmp) { int r = onion_response_write0(res, tmp); onion_low_free(tmp); return r; } else return onion_response_write0(res, data); }