HTML_ENCODE(3)

NAME
html_encode - Encodes a string as HTML

SYNOPSIS

#include <libweb/html.h>

char *html_encode(const char *s);

DESCRIPTION
The html_encode() function encodes the null-terminated string given by s, replacing HTML reserved symbols, such as < or >, into their equivalents, such as &gt; or &lt;.

RETURN VALUE
On success, a valid pointer to a HTML-encoded, null-terminated string is returned. On failure, a null pointer is returned.

ERRORS
No errors are defined.

SEE ALSO
html_node_set_value(3), libweb_html(7).

COPYRIGHT
Copyright (C) 2023-2025 libweb contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.