Explicitly report HTML as UTF-8 when loading into Maid
Explicitly report HTML as UTF-8 when loading into Maid

Previously, the trimText() function would wrap any HTML you gave it into
a generic encoding-neutral wrapper, and parse that with DOMDocument. The
problem is, we're not setting a default character encoding anywhere, and
in the absence of an explicit character encoding in the HTML,
DOMDocument's parser assumes the current mb_internal_encoding(), which
happened to leave at its default, latin-1.

Since all the text we handle internally should be UTF-8, I changed the
wrapper to include an explicit encoding in a <meta> tag, which makes
DOMDocument load the HTML as UTF-8, and return correct results.

Fixes #735.

skript-cc/bolt,codesman/bolt,nantunes/bolt,hugin2005/bolt,HonzaMikula/masivnipostele,CarsonF/bolt,romulo1984/bolt,codesman/bolt,rossriley/bolt,pygillier/bolt,marcin-piela/bolt,bolt/bolt,GawainLynch/bolt,Intendit/bolt,pygillier/bolt,GDmac/bolt,winiceo/bolt,nantunes/bolt,tekjava/bolt,skript-cc/bolt,rarila/bolt,marcin-piela/bolt,CarsonF/bolt,cdowdy/bolt,Intendit/bolt,one988/cm,kendoctor/bolt,hugin2005/bolt,Raistlfiren/bolt,electrolinux/bolt,Calinou/bolt,GDmac/bolt,bywatersolutions/reports-site,hannesl/bolt,cdowdy/bolt,Raistlfiren/bolt,Eiskis/bolt-base,xeddmc/bolt,nikgo/bolt,richardhinkamp/bolt,HonzaMikula/masivnipostele,richardhinkamp/bolt,one988/cm,xeddmc/bolt,Raistlfiren/bolt,bywatersolutions/reports-site,winiceo/bolt,CarsonF/bolt,lenvanessen/bolt,HonzaMikula/bolt,joshuan/bolt,codesman/bolt,Eiskis/bolt-base,HonzaMikula/masivnipostele,kendoctor/bolt,Calinou/bolt,Eiskis/bolt-base,xeddmc/bolt,HonzaMikula/masivnipostele,electrolinux/bolt,cdowdy/bolt,Calinou/bolt,rarila/bolt,richardhinkamp/bolt,marcin-piela/bolt,rossriley/bolt,GawainLynch/bolt,hugin2005/bolt,hannesl/bolt,pygillier/bolt,hannesl/bolt,tekjava/bolt,GawainLynch/bolt,one988/cm,romulo1984/bolt,joshuan/bolt,GDmac/bolt,one988/cm,tekjava/bolt,GDmac/bolt,hannesl/bolt,kendoctor/bolt,romulo1984/bolt,nikgo/bolt,tekjava/bolt,skript-cc/bolt,lenvanessen/bolt,rossriley/bolt,HonzaMikula/bolt,nikgo/bolt,winiceo/bolt,Eiskis/bolt-base,rarila/bolt,Intendit/bolt,winiceo/bolt,bolt/bolt,HonzaMikula/bolt,pygillier/bolt,joshuan/bolt,rossriley/bolt,bywatersolutions/reports-site,lenvanessen/bolt,richardhinkamp/bolt,bolt/bolt,HonzaMikula/bolt,hugin2005/bolt,nantunes/bolt,nantunes/bolt,Calinou/bolt,xeddmc/bolt,electrolinux/bolt,nikgo/bolt,lenvanessen/bolt,bolt/bolt,Intendit/bolt,kendoctor/bolt,romulo1984/bolt,Raistlfiren/bolt,GawainLynch/bolt,cdowdy/bolt,electrolinux/bolt,marcin-piela/bolt,codesman/bolt,CarsonF/bolt,skript-cc/bolt,joshuan/bolt,bywatersolutions/reports-site,rarila/bolt