Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding_out is broken #42

Open
citrin opened this issue Sep 10, 2016 · 0 comments
Open

encoding_out is broken #42

citrin opened this issue Sep 10, 2016 · 0 comments

Comments

@citrin
Copy link

citrin commented Sep 10, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant