Open onebeat opened 3 years ago
Please show us your result, too. Where and how does the utf8 issue appear?
Hello, you can see it on pdf which i have uploaded... qrbill-issue.pdf
Thank you for the example.
I can confirm that TcPdfOutput
and to some extent FpdfOutput
do not fully support the utf8 charset. It works for characters like é
, but others like ł
or ą
are displayed as ?
.
Based on a quick Google search, this seems to be a widespread issue. It is discussed here, for instance.
Maybe @sdespont or @Franco2911 know how to fix this issue?
Hello, i have solved issue with help of your link and my trying to digg up the part of code where QRbill uses fonts definition..
As mentioned above, this is a problem of TcPpdf/Fpdf and ISO-8859-1 encoding. When usign TCPDF, the easiest is to set
private const FONT = 'dejavusans';
in
src/PaymentPart/Output/TcPdfOutput/TcPdfOutput.php:25
Just keep in mind that if you are using composer that you can't change it directly in vendor folder. Make own copy of it.
Just keep in mind that if you are using composer that you can't change it directly in vendor folder. Make own copy of it.
Or you provide a pr to fix it for good within this library 😉
Just keep in mind that if you are using composer that you can't change it directly in vendor folder. Make own copy of it.
Or you provide a pr to fix it for good within this library 😉
Totally agree. If there will be time, I will look at it.
I just switch from Fpdf to Tcpdf in my project. I didn't have problem before. But now, I have encoding issues with some characters ("é"). And only on native texte of swiss qr bill. If I manually replace helvetica to dejavusans in private "private const FONT = 'dejavusans';", it works well. Why did you revert your commit that added the possibility to change font please ?
EDIT: I had version 4.6. After updating to version 4.15, it's working fine now. Sorry
Hello, i am using tcpdf as output option. Here is my code
$tcPdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8');
$tcPdf->setPrintHeader(false);
$tcPdf->setPrintFooter(false);
$tcPdf->AddPage();
$output = new QrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput($qrBill, 'en', $tcPdf);
$output->setPrintable(false)->getPaymentPart();
Originally posted by @onebeat in https://github.com/sprain/php-swiss-qr-bill/issues/130#issuecomment-856123200