Subject: | Incompatibility in Wide character handling |
I am trying to use PDF::Template with PDF::API2 and the barcode font
found in http://www.squaregear.net/fonts/free3of9.shtml
I got a "Wide character found in ..." error. After some tracking, I
found that API2 returns font name in different encoding under different
versions of perl. I wrote the following file to gather more info.
Show quoted text
--- START ---
#!/usr/bin/perl
use PDF::API2;
use Data::Dumper;
my $font = $pdf->ttfont("/tmp/FRE3OF9X.TTF");
print Dumper($font);
--- END ---
When running the above program under perl 5.8.6, I got
...
'BaseFont' => bless ({ 'realised' => 1, 'val' =>
'CBC+Free3of9ExtendedResular~1167847864'},
...
But when running it under 5.8.8, I got
...
'BaseFont' => bless ({ 'realised' => 1, 'val' =>
'CBC+\x{6f00}\x{6600}\x{3900}\x{4500}...Free3~1167847955'},
...
Notice that API2 returns wide characters in the base font when using
perl 5.8.8. This somehow upsets PDF::Template or my PDF reader which
said the pdf file is corrupted.