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

Custom Type for Telephone #50

Closed
degiorgig opened this issue Apr 11, 2016 · 1 comment
Closed

Custom Type for Telephone #50

degiorgig opened this issue Apr 11, 2016 · 1 comment

Comments

@degiorgig
Copy link

Hi all,
I would like to add a custom type to a telephone number:

final Telephone telCAP = new Telephone("123456789");
telCAP.getParameters().setCharset("ISO-8859-1");
telCAP.getParameters().addType("SPÉCciälö"));//
vcard.addTelephoneNumber(telCAP);

but the accents are not encoded, can someone please help me?

Regards
G.

@mangstadt
Copy link
Owner

Hi G,

Unfortunately, there is no way to specify the character set of a parameter value. The CHARSET parameter only applies to property values.

If you want to use characters like the ones in your example inside parameter values, then you'll have to set the encoding of the entire vCard to UTF-8 or something of the sort. For example:

OutputStream out = new BufferedOutputStream(new FileOutputStream(new File("output.vcf")));
Writer writer = new OutputStreamWriter(out, "UTF-8");
VCardWriter vcardWriter = new VCardWriter(writer, VCardVersion.V3_0);

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

No branches or pull requests

2 participants