You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I exported a set of contacts from my icloud.com account. This file appears to be correct but when importing using the multiple imports method I get this error:
SyntaxError: Invalid vCard: Expected "VERSION:\d.\d" but found "undefined"
Here is how read and import the file:
var contactData = fs.readFileSync("./samples/multiple-contacts-from-icloud.vcf","utf8", "utf8");
var contacts = vCard.parse(contactData); //multiple
I suspected that Apple/iCloud file export only used newline ascii 10 or x0A. So i replaced it with the carriage return, newline.. I wonder if this could be added to the normalize() sequence. contactData = contactData.replace(new RegExp(String.fromCharCode(10), 'g'), '\r\n');
Thanks, but due to #31 we cannot add this to the normalization, as also further touched on in #34 (comment). TLDR; it breaks other things. So unfortunately users of this module will have to replace LF -> CRLF themselves, if they know it is safe to do so.
I suspected that Apple/iCloud file export only used newline ascii 10 or x0A.
I'd think that it would emit a VCF file with CRLF, but have never tested it. Could also be that a text editor automatically translated CRLF -> LF, if you opened the file in one by any chance? (That seems to be a common occurrence)
I exported a set of contacts from my icloud.com account. This file appears to be correct but when importing using the multiple imports method I get this error:
SyntaxError: Invalid vCard: Expected "VERSION:\d.\d" but found "undefined"
Here is how read and import the file:
I've attached my sample file here, i appended the '.txt' extension to allow attach here.
multiple-contacts-from-icloud.vcf.txt
The text was updated successfully, but these errors were encountered: