Wallabag: Export to PDF: wrong encoding for Cyrillic sumbols (utf-8)

Created on 24 May 2016  ·  7Comments  ·  Source: wallabag/wallabag

Issue details

Wrong encoding for cyrillic symbols in PDF export file.

Environment

  • wallabag version (or git revision) that exhibits the issue: 2.0.4
  • How did you install wallabag? Via git clone or by downloading the package?: git clone
  • Last wallabag version that did not exhibit the issue (if applicable): -
  • php version: PHP 5.5.9
  • OS: Ubuntu 14.04 x64
  • type of hosting (shared or dedicated): dedicated
  • which storage system you choose at install (SQLite, MySQL/MariaDB or PostgreSQL): SQLite

    Steps to reproduce/test case

  1. Add https://geektimes.ru/company/dronk/blog/275856/
  2. Export to PDF

Other export formats (epub, mobi, txt, xml, json, csv) have normal encoding.

Bug pdf

All 7 comments

Version 2.1.2
PHP5
Debian 8
On dedicated
MySQL (MariaDB)

Bug reproduced. "?" instead Cyrillic symbols.

Same with Polish articles

Any chance on fixing this?

It's because Helvetica font (which bundled with tcpdf library) doesn't have cyrillic symbols.
As for me, i have found a little workaround.
You can change default fonts in the tcpdf config file vendor/wallabag/tcpdf/config/tcpdf_config.php: PDF_FONT_NAME_MAIN and PDF_FONT_NAME_DATA.
i.e. you can use 'dejavusans' (or 'dejavuserif') instead of 'helvetica' for cyrillic (there are some thai fonts in vendor/wallabag/tcpdf/fonts folder for thai).
'freesans', 'freeserif' etc are also works.

@asocialpsihopat Interesting. Do you know if there is a font that can cover all languages? So we can enable it by default

@j0k3r , I think that PDF is for printing, so we can use standard CMU series. Or something more popular, like Libertation family, used by default in Libre Office. This fonts has support for many languages

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anarcat picture anarcat  ·  4Comments

Simounet picture Simounet  ·  6Comments

erixtekila picture erixtekila  ·  7Comments

shtrom picture shtrom  ·  5Comments

amereservant picture amereservant  ·  5Comments