kiz has asked for the wisdom of the Perl Monks concerning the following question:
Everything is installed, and the code runs. Data Dumper prints out:#!/path/bin/perl use Data::Dumper; use PDF::API2; use Encode; my $dir = '/tmp/'; my $file = $dir.'test.pdf'; my $pdf = PDF::API2->open($file); my %info = $pdf->info; print Dumper(%info); foreach my $key (sort keys %info) { print "$key ->"; print decode("utf8", $info{$key}); print "\n"; }
but decode barfs with "Cannot decode string with wide characters"$VAR1 = 'CreationDate'; $VAR2 = 'D:20060817180621+01\'00\''; $VAR3 = 'Producer'; $VAR4 = "\x{4f00}\x{7000}\x{6500}\x{6e00}\x{4f00}\x{6600}\x{6600}\x{69 +00}\x{6300}\x{6500}\x{2e00}\x{6f00}\x{7200}\x{6700}\x{2000}\x{3200}\x +{2e00}\x{3000}"; $VAR5 = 'Creator'; $VAR6 = "\x{5700}\x{7200}\x{6900}\x{7400}\x{6500}\x{7200}"; $VAR7 = 'Author'; $VAR8 = "\x{4200}\x{6f00}\x{6200}\x{2000}\x{5700}\x{6500}\x{6200}\x{73 +00}\x{7400}\x{6500}\x{7200}"; $VAR9 = 'Title'; $VAR10 = "\x{4300}\x{4f00}\x{4d00}\x{5000}\x{4500}\x{5400}\x{4900}\x{5 +400}\x{4900}\x{5600}\x{4500}\x{2000}\x{5300}\x{4100}\x{4600}\x{4100}\ +x{5200}\x{4900}";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Decoding UTF-8 - "Cannot decode string with wide characters"
by shmem (Chancellor) on Aug 24, 2006 at 17:29 UTC | |
|
Re: Decoding UTF-8 - "Cannot decode string with wide characters"
by jeteve (Pilgrim) on Aug 25, 2006 at 12:57 UTC | |
by shmem (Chancellor) on Aug 25, 2006 at 14:25 UTC |