The
unent
command reads the
file
(or standard input) and copies it to standard output with &-entities
by their equivalent character (encoded as UTF-8). E.g., " is
replaced by " and < is replaced by <.
The four builtin entities of XML (< > " &) are not
replaced but copied unchanged. This is necessary if the output has to
be valid XML or SGML.
This option changes how unknown entities or lone ampersands are handled. Normally they are copied unchanged, but this option tries to "fix" them by replacing ampersands by &. Often such stray ampersands are the result of copy and paste of URLs into a document and then this option indeed fixes them and makes the document valid.
The program assumes entities are as defined by HTML. It doesn't read a
document's DTD to find the actual definitions in use in a document.
With
-f,
it will even remove all entities that are not HTML entities.