Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Compiling this MWE (mwe.tex)

\documentclass{article}
\usepackage[greek,italian]{babel}
\usepackage[utf8x]{inputenc}
\begin{document}
\latintext chars with àccéènts
greek chars \greektext ασδφγη
\end{document}

with C:\Program Files (x86)\MiKTeX 2.9\scripts\tex4ht\htlatex.bat mwe.tex (after it was succesfully compiled with pdflatex) produces an ANSI rather than an UTF-8 encoded HTML file. That is, mwe.html once opened shows

chars with ΰccιθnts greek chars ασδφγη

and I can display chars correctly only if I manually change browser encoding to ISO-8859-1.

I also tried a bunch of options for htlatex (the compilation output of htlatex mwe "xhtml, charset=utf-8" " -cunihtf -utf8" is available here), but none solved the problem, any clue?

FOLLOW UP

Since the solution given in answer works fine with TeXLive under Ubuntu, I guess the issue with MikTeX under Windows is due to MikTex.

Here's the log of the test requested by michal.h21:

>tex4ht -he -cunihtf -utf8 mwe
----------------------------
tex4ht.c (2010-12-16-08:39 Windows MiKTeX)
tex4ht -he
  -cunihtf
  -utf8
  mwe
(C:/Program Files (x86)/MiKTeX 2.9/tex4ht/base/win32/tex4ht.env)
(C:/Program Files (x86)/MiKTeX 2.9/fonts/tfm/public/cbgreek/grmn1000.tfm)
(C:/Program Files (x86)/MiKTeX 2.9/tex4ht/ht-fonts/unicode/cbgreek/grmn.htf)
--- error --- Illegal storage address

  K `y          cmr10   &&

I tried to refresh TeX name database with texhash and mktexlsr but "illegal storage address" problem is still there.

share|improve this question
    
please try to run only tex4ht -he -cunihtf -utf8 mwe and paste the log here –  michal.h21 Jun 14 '13 at 16:54
    
Done, see log in question. –  mmj Jun 14 '13 at 18:04
add comment

1 Answer

up vote 1 down vote accepted

I don't have miktex, so don't know what means that error message about path, but for utf-8 output, you must run htlatex with:

htlatex mwe "xhtml, charset=utf-8" " -cunihtf -utf8"

result:

chars with àccéènts greek chars ασδφγη

share|improve this answer
    
Did it, same wrong result and same exit code 1 for same reason. –  mmj Jun 13 '13 at 16:10
    
@mmj: Michal's command line works fine for me on miktex 2.9. Can you show the complete command line output? –  Ulrike Fischer Jun 13 '13 at 16:17
    
@mmj as @Ulrike said, please show us complete log file, it may be some problem with your tex4ht instalation –  michal.h21 Jun 13 '13 at 16:26
1  
Thanks, I added in the question a link to the output. I found out that the path problem does not concern tex4ht (it shows up even when I open a command line window!). I also discovered that, with your options, actually no new html file is produced, I was looking at the previously generated html file, due to --- error --- Illegal storage address, which you will find at the end of output. Such error does not show up compiling without options. –  mmj Jun 13 '13 at 23:25
    
I could not make your solution work under MikTeX, so I switched to TeXLive under Ubuntu and it worked. In general, switching from MikTeX under Windows to TeXLive under Ubuntu let me solve not only this one, but other severe issues too. –  mmj Dec 2 '13 at 9:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.