ranguard / text-vcard

Perl package to edit and create vCard(s) (RFC 2426)
22 stars 15 forks source link

vCard 2.1 exported from Palm OS is not parsed #41

Open citrin opened 7 years ago

citrin commented 7 years ago

I got an error Wide character in subroutine entry at /usr/local/lib/perl5/site_perl/Text/vCard/Node.pm line 134. while trying to read vCard file from Palm OS.

File encoding is cp-1251, my code is

my $address_book = vCard::AddressBook->new(encoding_in => 'cp1251', encoding_out => 'cp1251');
$address_book->load_file('./test.vcf');

Value in vCard has ENCODING=QUOTED-PRINTABLE but also contains characters in cp1251.

Currently vCard first converted from cp1251 to utf-8 and than QUOTED-PRINTABLE is decoded. to fix this problem QP should be decoded and than result string converted from cp1251 to utf-8.

I can share test vCard if need.

citrin commented 7 years ago

If QUOTED-PRINTABLE is applied to all 8bit characters, than other problem is seen: after decoding QP string is not converted from encoding_in to utf8.