Fix issue with UTF-8 BOM when charset only in HTML.

Fixes #348