Opened 7 years ago

UTF-8 wiki pages don't work

Reported by: Owned by: anonymous diorgenes high TracWikiToPdfPlugin critical 0.11

Description

I have wiki pages in UTF-8. And I can't convert them to PDF. I get ???? instead of letter.

This is what I found, but how could this be applied to TracWikiToPdfPlugin?

comment:1 Changed 7 years ago by anonymous

Actually, if I configure Trac like this:

[trac]
default_charset = utf-8


I get letters, but not correct. Not real text.

comment:2 Changed 7 years ago by izzy

Looks like you are right with your assumption. I just remember from another project, for Postscript (closely related to PDF) there was only Latin-1 available as input, no UTF-8 (thought it was not connected with HTMLDoc). So the problem probably is, non-Latin1 content would have to be converted to Latin-1 first - which of course only works as long as used characters are compatible.

comment:3 Changed 6 years ago by Calle Kabo

htmldoc 1.8 doesn't support UTF-8. Download and install htmldoc 1.9 from http://www.htmldoc.org/software.php and it works like a charm :)

comment:4 Changed 6 years ago by anonymous

Htmldoc 1.9 didn't work for me. Still oin 1.8. Here is dirty but solution (works for me). Implement an extra default_charset parameter in wikitopdf section

[trac]
default_charset = utf-8

[wikitopdf]
default_charset = windows-1251


Patch string tracwikitopdfplugin/0.11/wikitopdf/wikitopdf.py

codepage = self.env.config.get('trac', 'default_charset', 'iso-8859-1')


to

codepage = self.env.config.get('wikitopdf', 'default_charset', 'iso-8859-1')


or do it with extra "if"

Use Serif bodyfont (for Cyryllic output) and set charset = cp-1251

comment:5 Changed 5 years ago by rjollos

#7081 closed as a duplicate.