Skip to main content

htmlspecialchars

Function htmlspecialchars 

Source
pub fn htmlspecialchars(
    s: &[u8],
    flags: HtmlFlags,
    double_encode: bool,
) -> Vec<u8> ⓘ
Expand description

PHP htmlspecialchars($string, $flags, 'UTF-8', $double_encode): escapes & < > and the quotes flags selects (' as &#039; in HTML 4.01, &apos; otherwise). With double_encode false, existing valid entities are kept. Invalid UTF-8 follows ENT_IGNORE/ENT_SUBSTITUTE, else the result is empty.