encode html as utf8 before writing out