in reply to HTML encoding UTF-8 characters in an HTML block

It encodes all of my HTML tags too, even though I though I'd told it to ignore <> characters.
Are you saying encode_entities encodes < and > given the string '&\'"[]\200-\377'? I'm looking at it's source and don't see how that's possible... OTOH, it will encode " (quote) in "http://www.w3.org/1999/xhtml", which will break HTML. It seems you'll have to parse HTML too. And maybe you'll have to decode text that XML::Twig returns (using Encode), and encode it back again... (I don't know how Twig works).