Answers.Body: <p>DOMPDF in CiviCRM have a trouble with special characters UTF-8. We have this same problem in Poland. I've create a repo with solution: <a href="https://github.com/ngo360/civicrm.dompdf.utf8" rel="nofollow noreferrer">https://github.com/ngo360/civicrm.dompdf.utf8</a></p>
  
  <p>For apply this change go to path: path/to/civicrm/vendor/dompdf and delete all files. Then upload files from repo. I think is resolve Your problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-28T23:37:53.930Z
Answers.Text: Thanks. Wondering do you still need to edit print.css as described at https://civicrm.stackexchange.com/questions/27735/how-to-change-the-encoding-in-pdf-documents or does this always enforce dejavu?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-29T12:16:09.893Z
Answers.Text: I only change this files - its works well. I don't make any changes in print.css It's simple pack for fix this issue. :)
Answers.UserDisplayName: Marcin Lewandowski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-01T03:22:56.803Z
Answers.Text: Ok upon examine again on dompdf\lib\fonts folder i noticed there was a ufm ,ufm.php and afm files generated for simsun, but it's named with some random numbers. So I changed those names to simsun, removed the @font code in print.css, rename the number font name represent as simsun in dompdf_font_family_cache.php, now it's working nice and clean!
Answers.UserDisplayName: Jennifer Lee
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-06T16:00:56.750Z
Answers.Text: Hi Jennifer - how did you get simsun font into the dompdf\lib\fonts folder? Where did you download it from? -- KarinG
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-28T22:59:45.733Z
Answers.LastActivityDate: 2019-03-28T22:59:45.733Z
Answers.UserDisplayName: Marcin Lewandowski
Body: <p>-I'm using Civicrm 5.11.0, Joomla 3.8.0, Windows 7<br>
  -SQL is encode in utf8<br>
  -Chinese characters in phpmysql are readable<br>
  -Chinese characters in Civicrm are readable<br>
  -Civicrm saves data in utf8, so import or export contacts in Chinese is fine<br>
  -CiviMail can send email with Chinese characters<br>
  -Win 7 can read Chinese characters and save word documents in pdf as Chinese<br>
  -but when I go to Individual>Contribution>Print Invoice as PDF, they all turn to question marks (one character, one question mark)<br>
  -put Chinese characters in invoice templates, turns to question marks too</p>
  
  <p>I tried to change this code <br></p>
  
  <pre><code>   $dompdf-&gt;load_html( $html );
  </code></pre>
  
  <p>to this</p>
  
  <pre><code>   $dompdf-&gt;load_html( utf8_decode( $html ) );
  </code></pre>
  
  <p>(from ../civicrm/CRM/Utils/PDF/Utils.php)<br>
  <br>but nothing happened, still question marks.<br>
  What could be the cause of this?
  <br><br><br>
  I also tried this on demo site, same results display.<br>
  <a href="https://i.sstatic.net/xFRFa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xFRFa.png" alt="enter image description here"></a>
  <a href="https://i.sstatic.net/uFEmF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/uFEmF.png" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-28T12:10:02.853Z
Comments.Text: Might be similar to https://civicrm.stackexchange.com/questions/27735/how-to-change-the-encoding-in-pdf-documents
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-30T10:25:58.350Z
Comments.Text: this works! Thank you! You saved my day again Demerit!
Comments.UserDisplayName: Jennifer Lee
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-16T13:46:34.850Z
Comments.Text: This has been raised as an issue https://lab.civicrm.org/dev/core/-/issues/2126
Comments.UserDisplayName: William Mortada
Tags: <pdf><invoice>
Title: Special Characters Become Question Marks "?" in PDF Printing
ThreadText: # Special Characters Become Question Marks "?" in PDF Printing
  
  (Asked by: username_0 on 2019-03-28)
  
  -I'm using Civicrm 5.11.0, Joomla 3.8.0, Windows 7
  -SQL is encode in utf8
  -Chinese characters in phpmysql are readable
  -Chinese characters in Civicrm are readable
  -Civicrm saves data in utf8, so import or export contacts in Chinese is fine
  -CiviMail can send email with Chinese characters
  -Win 7 can read Chinese characters and save word documents in pdf as Chinese
  -but when I go to Individual>Contribution>Print Invoice as PDF, they all turn to question marks (one character, one question mark)
  -put Chinese characters in invoice templates, turns to question marks too
  I tried to change this code 
     $dompdf->load_html( $html );
  
  to this
     $dompdf->load_html( utf8_decode( $html ) );
  
  (from ../civicrm/CRM/Utils/PDF/Utils.php)
  but nothing happened, still question marks.
  What could be the cause of this?
  
  I also tried this on demo site, same results display.
  
  **Tags:** pdf, invoice
  
  > **Comments:**
  > **username_1**: Might be similar to https://civicrm.stackexchange.com/questions/27735/how-to-change-the-encoding-in-pdf-documents  
  > **username_0**: this works! Thank you! You saved my day again username_1!  
  > **username_2**: This has been raised as an issue https://lab.civicrm.org/dev/core/-/issues/2126  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-03-28. Score: 4 | Accepted answer
  
  DOMPDF in CiviCRM have a trouble with special characters UTF-8. We have this same problem in Poland. I've create a repo with solution: <https://github.com/ngo360/civicrm.dompdf.utf8>
  
  For apply this change go to path: path/to/civicrm/vendor/dompdf and delete all files. Then upload files from repo. I think is resolve Your problem.
  
  > **Comments:**
  > **username_1**: Thanks. Wondering do you still need to edit print.css as described at https://civicrm.stackexchange.com/questions/27735/how-to-change-the-encoding-in-pdf-documents or does this always enforce dejavu?  
  > **username_3**: I only change this files - its works well. I don't make any changes in print.css It's simple pack for fix this issue. :)  
  > **username_0**: Ok upon examine again on dompdf\lib\fonts folder i noticed there was a ufm ,ufm.php and afm files generated for simsun, but it's named with some random numbers. So I changed those names to simsun, removed the @font code in print.css, rename the number font name represent as simsun in dompdf_font_family_cache.php, now it's working nice and clean!  
  > **username_4**: Hi Jennifer - how did you get simsun font into the dompdf\lib\fonts folder? Where did you download it from? -- KarinG  
  
  ---
  
  