encode html as utf-8 before passing it to pisa