I get the characters in my PDF file, I deleted \ r \ n \ r \ n \ t, truncated everything, decoded the html objects and split the tags. Nothing helps. The data comes from the MySQL database.
Any help would be appreciated.
Check string encoding (using mb_detect_encoding) before adding to pdf, is it a unicode string? Data in MySQL db may be in unicode, but your db connection may use some other encoding.
Have you tried using utf8_decode ()? http://php.net/manual/en/function.utf8-decode.php
, , .
- , :
$str = 'Hello World'; echo str_replace(chr(ord('')), '[removed]', $str);
:
Hello [removed] World
$string = "testContainingSpecialCharsäöüöüäüß"; $pdf->Cell(0,0,$string);
?
FPDF Unicode, . http://acko.net/node/56, , , PDF ( TCPDF).
iconv UTF-8 (.. $str = iconv('UTF-8', 'windows-1252', $str);), FPDF.
$str = iconv('UTF-8', 'windows-1252', $str);
Similar to the result of what happens when you copy / paste text from a Microsoft word. Can a PDF file contain text from an MS Word document by accident? This may be your problem. There are some interesting comments for converting and removing these characters in PHP on the PHP.net website: http://www.php.net/manual/en/function.strtr.php#39383
I just assume that these are MS Word characters in your PDF file.
Source: https://habr.com/ru/post/1746326/More articles:Initial issue with sending data table in JsonResult - jqueryКак я могу получить цвет текста кнопки с помощью вещества LaF? - javaHow to create a new identifier for a newly added node? - javascriptHow to return autocompletion after the method name is written in Eclipse? - javaUnable to modify table - mysqlUse maven + yguard - javaTag injection in JDO - javaJoomla, Drupal, DotNetNuke or something else for a sports club? - joomlaCountdown timer in asp.net - c #How can we get the auto-generated identifier from the table when pasting? - c #All Articles