-
Notifications
You must be signed in to change notification settings - Fork 93
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
Erroneous character encoding when line is wrapped according to lineLength
#80
Comments
Thanks for the post. Have you actually tried importing such a vCard into Google Contacts or are you just speculating that this might happen? You are referring to line folding. It is part of the vCard syntax. It allows you to split a long line into multiple lines without loosing any data. For example, the two vCards below are identical.
Line folding is optional. You can turn it off like so: VCardWriter writer = ...
writer.getVObjectWriter().getFoldedLineWriter().setLineLength(null); |
I did tried to import as-is. Alas, those two cards are not equal for Google Contacts. If you try to decode the first card at http://www.webatic.com/run/convert/qp.php, you would get similar error. I the end I actually called |
Are you sure? Did you include the space character on the fourth line of the first vCard?
You must have done something wrong. All those methods are public. :-P |
I am. This is original card:
This is converted card:
This is the Google imported one: The code that produces it: String path = "test.vcf";
File file = new File(path), fileOut = new File("test_converted.vcf");
Ezvcard.write(Ezvcard.parse(file).all()).version(VCardVersion.V4_0).go(fileOut); On your piece of code: VCardWriter writer = ...
writer.getVObjectWriter().getFoldedLineWriter().setLineLength(null); I know |
The Try outputting to version 2.1 and uploading that to Google. Only version 2.1 is supposed to support quoted printable text. Ezvcard.write(Ezvcard.parse(file).all()).version(VCardVersion.V2_1).go(fileOut); I have one more idea to try if that doesn't work. |
Same result on google for card text:
Moreover Google doesn't import phone number from You should also try more wise line wrapping. In that case don't split |
Can you test something? Can you put this vCard (below) into Google and tell me if it works? I think it might work. This vCard does not have the spaces at the beginning of the lines:
Thanks for doing the testing. |
Everything works for me now. Thanks! This one can be closed. |
Excellent. Thanks for your help. |
Characters are encoded by two bytes In Russian:
=D0=A2=D0=B0=D0=BC=D0=B0=D1=80=D0=B0
forТамара
. Your writer for some reason might wrap the line in the middle of encoded string:=D0=A2=D0=B0=D0=BC=D0=B0=D1=80=D0\n=B0
. The last string won't be decoded by Google Contacts importer, for example. It would beТамар� �
instead.The text was updated successfully, but these errors were encountered: