Subject: | Inserting images fails with LANG=UTF8 |
From: | frankie [...] etsetb.upc.edu |
Hi. I spotted a serious problem. It only happens when some circumstances are met. Images are added wrong in the PDF when LANG=UTF8 and a DBI networking connection is made.
I've been digging the root of the problem. I will try to explain the best that I can.
The PDFs created are different in the line where the image size is defined in the PDF file.
When LANG=ca_ES@euro
PDF: 510.236220472441 0 0 841.889763779528 0 0 cm
When LANG=ca_ES.UTF-8
PDF: 510,236220472441 0 0 841,889763779528 0 0 cm
Notice when the PDF is wrong the decimal separator is "," instead ".". Something happens somewhere in the DBI networking process that triggers a change in that. Then it affects the image size definition inside the PDF.
I tried many different DBI releases and it always happen the same. I also tried connection to mysql and postgress servers. The connection doesn't need to complete right. A bogus hostname does the trick :
eval {DBI->connect("DBI:Pg:host=WHATEVER") };
PDF::Create v1.05
DBI v1.609
perl v5.10.1
I can also send a minimal script that creates the wrong PDF if you need it.