Set charset Windows-1250?

LiteCart Fan
จาก Czech Republic
เป็นสมาชิกตั้งแต่ มี.ค. 2015

Hello,
I do not know how I FPDF set encoding windows-1250 (Central Europe)?? UTF-8 is not working with fpdf and library "tfpdf" is not working with php7.

Thank you for the advice.

tim
Founder
จาก Sweden
เป็นสมาชิกตั้งแต่ พ.ค. 2013
tim

Fact is, FPDF is built for Windows-1252 whereby UTF-8 is decoded to Windows-1252. You can play around with these lines in includes/classes/pdf.inc.php.

  public function Text($x, $y, $txt) {
      $txt = mb_convert_encoding($txt, 'Windows-1252', language::$selected['charset']);
      //$txt = iconv($txt, language::$selected['charset'], 'Windows-1252');
      return parent::Text($x, $y, $txt);
  }

Also make sure all your language properties and storage encoding are set to your desired charsets LiteCart.

tim
Founder
จาก Sweden
เป็นสมาชิกตั้งแต่ พ.ค. 2013
tim

If you need to encode more fonts and/or charsets see this guide:

http://fpdf.org/en/tutorial/tuto7.htm

LiteCart Fan
จาก Czech Republic
เป็นสมาชิกตั้งแต่ มี.ค. 2015

So, I figured it out :)
The problem was that I use linux and windows-1250 encoding is not working. It must use ISO-8859-2 and then let it generate fonts with this encoding - then everything is working :)

Moderator
จาก Lithuania
เป็นสมาชิกตั้งแต่ มี.ค. 2016

edit: created new post for better navigation

คุณ
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.