not correct export character

Created on 26 January 2019, almost 6 years ago
Updated 5 September 2024, 3 months ago

hi
i use in module but when export page not correct charecter persian language and replace by ???????????????? or Dropping between letters in word.

🐛 Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

🇮🇷Iran h.parsi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom matt b

    Same issue here. Any updates or support for this?

  • Status changed to Postponed: needs info 5 months ago
  • 🇺🇸United States smustgrave

    Could more steps be added by chance? But thanks to @Matt B in #3 seems like this might be an issue with dompdf maybe an issue should be logged there instead?

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Reading About Fonts and Character Encoding, I gather it could be an issue with this module, which should reference the correct font in the used CSS stylesheet.

  • Issue was unassigned.
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The attached screenshot does not show the described bug. It just shows the screenshot of part of a node, where the PDF link is present.

  • Status changed to Active 5 months ago
  • 🇺🇸United States smustgrave

    Thanks for taking a look @apaderno

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Also, what does dropping between letters exactly mean?

  • 🇺🇸United States smustgrave

    Not familiar with other languages but I took that as the letter appears slightly lower then expected/not centered with rest of the word. But just how I took it.

  • Status changed to Postponed: needs info 5 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    That would be dropping letters.
    Given the screenshot does not show exactly what the bug is, and the description is not clear, this needs more information from the OP.

  • 🇬🇧United Kingdom matt b

    I cannot comment for the OP, but I'm still struggling to get output in Farsi / Persian.

    I've set

    * {
        font-family: 'DejaVu Sans', sans-serif, Courier;
    }

    In the css, and whilst it now produces characters instead of lots of ??? (one or two specific issues in my header, which I'll look at separately), but when I copy and translate the text back to english using google translate it's clearly not giving me the original text, and when I compare to the original text in Drupal it is different - something is happening in the PDF production process.

    This text (from both the node content and .../debug) looks correct (probably reverts to LTR here) :

    در اشعيا باب ۵۵ آيه ٣ خدا از ما ميخواهد که به نزد او بياييم، به او گوش دهيم و زندگی واقعی پيدا کنيم .
    خدا نمی خواهد ما هلاک شويم. او می خواهد که ما در پادشاهی او باشيم و به پسر عزيزش عيسی اين امکان را داده است تا او اين امر را فراهم کند.

    But is displayed in the PDF as

    هب ،مييايب وا دزن هب هک دهاوخيم ام زا ادخ ٣هيآ ۵۵باب ايعشا رد
    . مينک اديپ یعقاو یگدنز و ميهد شوگ وا
    وا یهاشداپ رد ام هک دهاوخ یم وا .ميوش کاله ام دهاوخ یمن ادخ
    وا ات تسا هداد ار ناکما نيا یسيع شزيزع رسپ هب و ميشاب
    . دنک مهارف ار رما نيا

  • 🇬🇧United Kingdom matt b

    I think the following is relevant, and this is probably a support request rather than a bug fix due this being a feature not supported by DomPDF?

    https://github.com/dompdf/dompdf/issues/2619
    https://github.com/dompdf/dompdf/pull/2107

    Also, google about, I got the hint that this may not be an issue with Wkhtmltopdf, so I might give that a try (something for another day!)

  • 🇬🇧United Kingdom matt b

    I've switched to using the Entity PDF module, which uses mpdf as the engine. It is rendering Arabic characters fine.

  • 🇩🇪Germany jurgenhaas Gottmadingen

    I'm having the same issue with simple German umlauts, they get printed as 2-byte character combination, as if dompdf is able to deal with UTF-8. Switching to wkhtmltopdf engine solves the issue, though.

  • 🇭🇺Hungary peri22

    Hello, I had the same problem with some characters. I have set the font-family and created a patch to fix the character encoding.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇧🇪Belgium johanvdr

    The patch throws this error in php 8.2.x

    Deprecated function: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated;

    Handling HTML entities via mbstring is deprecated in PHP 8.2.

  • 🇧🇪Belgium johanvdr

    I have updated the patch from #19 🐛 not correct export character Postponed: needs info . There was a small issue with the conversion map array.

  • 🇧🇪Belgium johanvdr

    Actually there is an even more simple fix that worked for me without any patch. Set the metatag header in entity-print.html.twig.

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

Production build 0.71.5 2024