It converts special characters like &, <, >, ", and ' into their corresponding HTML entity codes so they display correctly instead of being interpreted as HTML markup.
It converts the five core special characters: & to &, < to <, > to >, " to ", and ' to '.
Yes, the decoder handles all named and numeric HTML entities, not just the core five, using a safe browser-native decoding method.
You need this when displaying text that contains characters with special meaning in HTML, such as showing a "<" symbol on a webpage without it being interpreted as the start of a tag.
Yes, the decoding method used here converts entities back to characters without executing any embedded scripts.