text-vcard
text-vcard copied to clipboard
encoding_out is broken
Sample code
use utf8;
use vCard;
my $vcard = vCard->new(encoding_out => 'cp1251');
$vcard->version('3.0');
$vcard->full_name('Ðван Ðванов');
$vcard->given_names([qw/Ðван/]);
$vcard->family_names([qw/Ðванoв/]);
print $vcard->as_string;
Output of this code
Wide character in print at ./encoding_out.pl line 18.
BEGIN:VCARD
VERSION;CHARSET=cp1251:3.0
N;CHARSET=cp1251:Ðванoв;Ðван;;;
FN;CHARSET=cp1251:Ðван Ðванов
END:VCARD
With string in utf-8, but should be
BEGIN:VCARD
VERSION:3.0
N;CHARSET=cp1251:Ðванoв;Ðван;;;
FN;CHARSET=cp1251:Ðван Ðванов
END:VCARD
with strings in cp-1251
I personally don't need this feature (discovered by accident) and think that better to have feature removed than broken. But it may be useful for transferring data to legacy software.