ccard-developers Mailing List for vCard/vCal Parser C Library
Brought to you by:
blackpaw
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: longhua.cheng <lon...@mm...> - 2008-12-15 02:24:04
|
HI: I am a developer from Chinese, I am using the ccard in our project, I found it very useful, thank you. In our project,the vcard text is in unicode format. so I have to do some additional work to use ccard. I wrote some code to do that job, I am very glad to share this code with you. Yes, we can change the unicode vcard text into ansi, use vcard parser,get some information we need, then change the information back to unicode. but this procedure will need a large unicode-ansi table,which is a kind of shortcoming in embedded programming. I find a way to change the unicode to pseudo-ansi,which means ansi-char(1 byte char) in uncode text is changed back to ansi, non-ansi char (2 bytes char) change to 4 ansi-char,whose ascii codes are all above 80h, thus, the ansi text won't infulence the ccard parser. when ccard parse have done the work, we can change the pseudo-ansi information back to unicode. following is the code, compiled ok in Visual C++ 6.0. int unicode_to_pseudo_ansi(char * desAnsi,int MaxDesCnt,char * srcUnicode) { int resultCount=0; unsigned char cHigh,cLow; unsigned short * pUnicode= (unsigned short *)srcUnicode; unsigned short aShort; while ( *pUnicode ) { if ( (MaxDesCnt>=0) && (resultCount >= MaxDesCnt) ) return resultCount; aShort= * pUnicode; cHigh= aShort >> 8; cLow = aShort & 0xff; if (! cHigh)//high byte is zero { *desAnsi++ = cLow; resultCount++; } else { if (cHigh >=0x80) { *(desAnsi++) =0xfe; *(desAnsi++) =cHigh; } else { *(desAnsi++) =0xff; *(desAnsi++) =cHigh | 0x80; } if (cLow >=0x80) { *(desAnsi++) =0xfe; *(desAnsi++) =cLow; } else { *(desAnsi++) =0xff; *(desAnsi++) =cLow | 0x80; } resultCount+=4; } pUnicode++; } *desAnsi = 0; return resultCount; } int pseudo_ansi_to_unicode(char * desUnicode,int MaxDesCnt,char * srcAnsi) { int resultCount=0; unsigned char cHigh,cLow; unsigned short * pUnicode= (unsigned short *)desUnicode; unsigned char * pAnsi=(unsigned char *)srcAnsi; while ( *pAnsi ) { if ( (MaxDesCnt>=0) && (resultCount >= MaxDesCnt) ) return resultCount; cLow = * pAnsi; if (cLow < 0x80) { *(pUnicode++) = cLow; pAnsi++; resultCount+=2; } else { if ( *pAnsi++ == 0xff ) cHigh = *pAnsi & 0x7f ; else cHigh = *pAnsi; pAnsi++; if ( *pAnsi++ == 0xff ) cLow = *pAnsi & 0x7f ; else cLow = *pAnsi; pAnsi++; *(pUnicode++) = cHigh<<8 | cLow; resultCount+=4; } } *pUnicode = 0; return resultCount; } //following code is not compiled ,just for example,for showing how to use that two funtions above. int Get_VCard_Info(const wchar * buf,int bufLen, char * name,char* phoneNo) { TUserData userData; CARD_Parser vp = NULL; int parseErr = FALSE; int rc, bufAnsiLen; char * bufAnsi=malloc(bufLen*2+1); unicode_to_pseudo_ansi(bufAnsi,bufLen*2,(char *)buf); bufAnsiLen= strlen(bufAnsi); memset(&userData, 0, sizeof(userData)); /* allocate parser */ vp = CARD_ParserCreate(NULL); /* initialise */ CARD_SetUserData(vp, &userData); CARD_SetPropHandler(vp, PropHandler); CARD_SetDataHandler(vp, DataHandler); memset(gCardData.name,0,NAME_LEN_MAX+1); memset(gCardData.phoneNumber,0,PHONE_NUM_LEN_MAX+1); /* parse */ rc = CARD_Parse(vp, bufAnsi, bufAnsiLen, FALSE); if (rc == 0) return 1; else {//gCardData is a globe variable, fill gCardData in " CARD_Parse" function already... pseudo_ansi_to_unicode(name, NAME_LEN_MAX ,gCardData.name); pseudo_ansi_to_unicode(phoneNo,PHONE_NUM_LEN_MAX,gCardData.phoneNumber); } /* finalise parsing */ if (!parseErr) CARD_Parse(vp, NULL, 0, TRUE); /* free parser */ CARD_ParserFree(vp); /* free up any remaining user data buffers */ free(userData.cardType); return 0; } Thanks! with best regards kimcom 2008-12-15 |
From: <ben...@id...> - 2004-05-22 12:55:55
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: David H. <dh...@iu...> - 2003-06-04 15:58:33
|
Hi I would like to use the ccard parser to test the validity of my generated vcards (2.1 and 3.0). However, I am not a C person and therefore am not sure as to the best way to use it - my preference is for a command that will take a vcard file and parse it displaying the errors if any to the screen. Am I right in thinking one of the sample programs does that? Also, I am using Redhat Linux 8 (gcc or g++) compiler so as there isn't a "makefile" for this setup I am a bit stuck. Naively using a command line compile of the test programs gives errors about not finding the CARD_XXX stuff; while compiling the cardparse.c file returns the error that In function `vcard_end_prop': undefined reference to `strcmpi' Sorry if these seem like dumb questions but as I said I am not a c person. Any help getting this off the ground would be most appreciated. Cheers, David -- ------------------------------------------------------------------- Dr David Hoare Systems Developer International Union of Crystallography 5 Abbey Square, Chester CH1 2HU, England Tel: +44 1244 342878 Fax: +44 1244 314888 E-mail: dh...@iu... ************************************************* ** ** ** Make sure you're in the new online edition ** ** of the World Directory of Crystallographers ** ** http://wdc.iucr.org ** ** ** ************************************************* ------------------------------------------------------------------- |
From: <lin...@op...> - 2003-04-19 03:11:13
|
test 2 ------------------------------------------ Lindsay http://www.blackpaw.com |
From: <lin...@op...> - 2003-04-18 23:32:02
|
------------------------------------------ Lindsay http://www.blackpaw.com |