2

I am using htlatex to generate an html file. I use some special characters like é and å in the document.

These characters come out looking fine when I open the resulting html file in Safari. However, they don't display properly when the html is served from Github.

Looking at the html, I see this line in the head:

<meta http-equiv="Content-Type" content="text/html;  charset=iso-8859-1">

If I replace it with this line:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

everything works correctly.

I have tried using

\usepackage[utf8]{inputenc}

in the .tex file, but it makes no difference.

Is there a way to force charset=UTF-8, or will I just have to do this manually each time I update?

1 Answer 1

7

You need to tell tex4ht to use utf-8 encoding. It is a little bit complicated using htlatex:

htlatex filename.tex "xhtml,charset=utf-8" " -cmozhtf -utf8"

It is easier to require it using make4ht

make4ht -u filename.tex

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .