HXUNENT(1)

✨ HXUNENT(1) ✨

okay bestie, listen up β€” this is hxunent from the HTML-XML-utils fam, and she is so much simpler than she sounds, i promise πŸ’–


🌸 NAME 🌸

hxunent β€” replace HTML predefined character entities by UTF-8 πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

hxunent [ -b ] [ -f ] [ file ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, the hxunent command reads the file (or standard input if you don't give her one πŸ₯Ί) and copies it over to standard output, except she swaps all the &-entities for their equivalent character, encoded as UTF-8. periodt.

for example: &quot; becomes " and &lt; becomes <. iconic behavior, honestly ✨


πŸ’– OPTIONS πŸ’–

here's everything she supports, no cap:

  • -b β€” the five builtin entities of XML (&lt; &gt; &quot; &apos; &amp;) are not replaced, they just get copied through unchanged. you need this if the output has to be valid XML or SGML. like, it's not a vibe thing, it's a requirement thing 🫢
  • -f β€” this one changes how unknown entities or lone ampersands get handled. normally they're copied unchanged (she's chill like that), but with this flag she tries to "fix" them by replacing ampersands with &amp;. ngl, those stray ampersands are usually what happens when you copy-paste URLs into a document 😭 and fr fr, this option does actually fix them and make the document valid. main character energy.

πŸ’€ DIAGNOSTICS πŸ’€

her exit value is 0 if everything went well ✨ otherwise:

  1. 1 β€” the input couldn't be read (file not found, file not readable... the usual tragic reasons πŸ™ˆ)
  2. 2 β€” wrong command line arguments. bestie. what did you type.

🌈 SEE ALSO 🌈

asc2xml(1), xml2asc(1), UTF-8 (RFC 2279)


πŸ“ BUGS πŸ“

okay so, real talk β€” the program assumes entities are as defined by HTML. she does not read a document's DTD to find the actual definitions in use in that document. so like, if your doc is being weird about its entities, that's why πŸ₯²

and heads up: with -f, she will even remove all entities that are not HTML entities. yes, all of them. not a drill πŸ’€


that's the whole page, bestie 🧚 β€” written for the HTML-XML-utils collection, version 7.x, dated 10 Jul 2011. go forth and unent, you've got this πŸ‘‘πŸ’œ