Giter Club home page Giter Club logo

vcardlib's People

Contributors

bolorundurowb avatar crowar avatar jeancollas avatar jochummedia avatar rallets avatar ramiassi avatar rmja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vcardlib's Issues

Xamarin iOS deployment

Hello

Because of your dependency of "CoreCompat.System.Drawing.v2" it's not possible to deploy on a real iOS Device, the linker will fail with the following message: "carbon framework not found"...

I removed this dependency (remove photo support) for the moment to get it working.

Best Greetings

Issue with Property BirthDay of vCard class

Shouldn't the type of property BirthDay be DateTime? instead of DateTime? IMHO, returning {1/1/0001 12:00:00 AM} when the vcard file does not have this information is bit wrong.

v3 Serializer adds closing brackets after the variable name

If I use the serializer with version 3, I have the problem that closing brackets appear in the code. For example at the phone number. This is also visible in the file v3Serializer.cs. Because of this the vCard can not be interpreted.

In both examples I used the same data:

BEGIN:VCARD
VERSION:2.1
REV:20211125T085009Z
N:Muster;Andreas;;;
KIND:Individual
GENDER:None
TEL;WORK: 4123456789
TEL;CELL: 41987654321
EMAIL;WORK:[email protected]
ADR;WORK:Gewerbepark,1234 Musterstadt,Österreich
END:VCARD

BEGIN:VCARD
VERSION:3.0
REV:20211125T085038Z
N:Muster;Andreas;;;
KIND:Individual
GENDER:None
TEL);TYPE=WORK: 4123456789
TEL);TYPE=CELL: 41987654321
EMAIL);TYPE=WORK:[email protected]
ADR);TYPE=WORK:Gewerbepark,1234 Musterstadt,Österreich
END:VCARD

Exception loading 'v4.vcf'

Ran with vCardLib/vCardLib.Tests/v4.vcf

   at vCardLib.Deserializers.v4Deserializer.ParseAddresses(String[] contactDetails)
   at vCardLib.Deserializers.Deserializer.Deserialize(String[] contactDetails)
   at vCardLib.Deserializers.Deserializer.GetCardFromContact(String[] contact)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at vCardLib.Deserializers.Deserializer.CreateCardsFromContacts(IEnumerable`1 contacts)
   at vCardLib.Deserializers.Deserializer.FromFile(String filePath)
   at source.cs:line 39

float.Parse in GetVcardFromDetails isn't working if decimal seperator != .

version = float.Parse(versionString.Replace("VERSION:", "").Trim());

results in wrong results if in CultureSettings is defined that the decimal seperator is not "." as in german (we using ,)

i replaced it with:

        float version;

        string dSep = CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator;
        if (dSep.Equals(",")) {

            version = float.Parse(versionString.Replace("VERSION:", "").Trim().Replace(".", ","));
        } else {

            version = float.Parse(versionString.Replace("VERSION:", "").Trim());
        }

iterate through item(x) objects

I have a vCard (vcf) created from an apple addressbook that contains tons of 'item1' or 'item2' lines. The content of these lines do not seem to be accessible in a vCardCollection. This is an issue for me as the vast majority of email addresses and physical addresses for the contacts are stored in these.

Example vCard from my .vcf:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN
N:xxx;xxx;;;
FN:xxx xxx
EMAIL;type=INTERNET;type=HOME;type=pref:xxx
TEL;type=CELL;type=VOICE;type=pref:xxx
ADR;type=HOME;type=pref:;;xxx;
item1.ADR:;;xxx;
item1.X-ABLabel:Son's home
UID:56d0a99f-224f-4523-b888-f0389f700058
X-ABUID:EF271691-7039-43D1-9E9C-C75D6A6010F6:ABPerson
END:VCARD

BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN
N:xxx;xxx;;;
FN:xxx xxx
EMAIL;type=INTERNET;type=HOME;type=xxx
TEL;type=CELL;type=VOICE;type=pref:xxx
ADR;type=HOME;type=pref:;;xxx;
UID:718c2455-de2f-483f-8abc-c7fe317f3232
X-ABUID:718C2455-DE2F-483F-8ABC-C7FE317F3232:ABPerson
END:VCARD

BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN
N:;;;;
FN:Apple Inc.
ORG:Apple Inc.;
TEL;type=MAIN;type=pref:1-800-MY-APPLE
item1.ADR;type=WORK;type=pref:;;1 Infinite Loop;Cupertino;CA;95014;United States
item1.X-ABADR:us
item2.URL;type=pref:http://www.apple.com
item2.X-ABLabel:_$!<HomePage>!$_
X-ABShowAs:COMPANY
UID:4F001569-0C4B-4E68-8444-26A705D04FC6
X-ABUID:51388BA1-125E-44D1-A906-CD4485BAFC97:ABPerson
END:VCARD

Import not working

Hello,

when using your sample code the import is not working for me. The object is just empty even though the vcf has content. Do i have to do anything else except your example code?

(Net 4.6 and V.1.1.1 of vCardLib.dll from NuGet)

Thanks

Serialize multiple vcard generate wrong start/end frame

Hi, I'm serializing multiple vcards, and the Start/End frame is generated on the same line, breaking the import in Android.
Basically it generates a vard that looks like

[...]
GENDER:None
END:VCARDBEGIN:VCARD
VERSION:3.0
[...]

but I'm expecting

[...]
GENDER:None
END:VCARD
BEGIN:VCARD
VERSION:3.0
[...]

Any tips?
Thank you

Кирилица

Данное решение не поддерживает кирилицу для Android.
В целом отсутсвует поддержка Encoding 👎

Взял себе на машину допилил Encoding для ios создаю Encoding.Unicode, а вот Android не получается ни как организовать.

Email addresses incorrectly parsed

VCF exported from GMail has the line:

EMAIL;TYPE=INTERNET;TYPE=HOME:[email protected]

This line parses as:

◢ | EmailAddresses | Count = 1 | System.Collections.Generic.List<vCardLib.Models.EmailAddress>
  | ◢ [0] | {vCardLib.Models.EmailAddress} | vCardLib.Models.EmailAddress
  | Email | "INTERNETHOME:[email protected]" | string
  | Type | None | vCardLib.Enums.EmailType

Can not import lib in vs2013

Install-Package : ZIP archive contains unsupported data structures.
At line:1 char:16

  • Install-Package <<<< vCardLib.dll
    • CategoryInfo : NotSpecified: (:) [Install-Package], NotSupportedException
    • FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

vCardCollection save - wrong format

When I try to save collection of vCards the END:VCARD
and new BEGIN:VCARD are writen in the same line,
and when I try to imported that file I get error.

If I manualy make linebreke with text editor and save file i can import multiple files...

my sample write code:

                    var cardList = new vCardCollection();

                    for (int i = 1; i < result.Tables[0].Rows.Count; i++)
                    {
                        DataRow row = result.Tables[0].Rows[i];

                        var card = new vCard();
                        card.Version = vCardLib.Helpers.Version.V3;
                        card.GivenName = row[0].ToString();
                        card.FamilyName = row[1].ToString();
                        var vca = new vCardLib.Models.EmailAddress();
                        vca.Email = new System.Net.Mail.MailAddress(row[2].ToString());
                        card.EmailAddresses.Add(vca);
                        var phone = new vCardLib.Models.PhoneNumber();
                        phone.Number = row[3].ToString();
                        card.PhoneNumbers.Add(phone);
                        cardList.Add(card);

                    }

                    cardList.Save("test.vcf", vCardLib.Helpers.Version.V3, vCardLib.Helpers.WriteOptions.Overwrite);

Add support for serialization to streams

There's currently support for deserializing using a stream, but not to serialize to a stream.
This would be helpful to directly write to files or HTTP bodies etc.

Custom Properties

Hi @bolorundurowb -
Thank you for making this library! Do you have any plans to expand this to enable custom properties? I'm wanting to make my app export a contact list that can be imported into Skype and it needs to support properties like X-SKYPE-DISPLAYNAAME

Thanks!

Serialize does not respect Revision DateTime

Hi, I'm serializing some vcard and to be able to unit test the serialized content in a simple way, I need to have an idempotent content.
As today the parameter Revision is not respected, and DateTime.Now is used instead.

As example:

var contacts = new List<vCardLib.Models.vCard> {
  new() {
    Version = vCardVersion.V3,
    Revision = new DateTime(2020, 01, 01),
    NickName = "A name",
  }
};
Serializer.Serialize(contacts);

Any suggestion?
Thank you

Wrong First Name and Surname in Serializing

The first name and last name during serialization (and maybe deserialization) is wrong. The current output of John Doe is:

N:John;Doe;
FN:John Doe

which should be:

N:Doe;John;;;
FN:John Doe

As per the Rfc2426, the value for token N is:

Family; Given; Middle; Prefix; Suffix

Lastly, IMHO, the vCard class should have these additional properties:

  • Middle Name
  • Prefix
  • Suffix

For Frapid framework, we're already using this library and would like to offer a helping hand.

  • Would you like us to fix these issues and send pull requests?
  • Once you accept the pull requests, how long would it normally take for it to appear in nuget?

'Input string was not in a correct format.'

BEGIN:VCARD
VERSION:2.1
N:;.;;;
FN:.
END:VCARD
BEGIN:VCARD
VERSION:2.1
N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:xxxxxxx;;;
FN;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLExxxxxx
TEL;CELL:+70000000000
END:VCARD

all vCard properties null

I tried the library with a vcf-file, which contains multiple vcf-cards. There will be created multiple vCard objects, but all their properties are null (although, they are NOT null in the vcf-file for sure).
On example vcard:

BEGIN:VCARD
VERSION:3.0
FN:
N:;;;;
EMAIL;TYPE=INTERNET:[email protected]
END:VCARD

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.