vcard

How can I prevent bad inputs when storing phone numbers as strings?

安稳与你 提交于 2019-11-30 18:29:19
问题 I am creating a phonebook program that can read VCards. The problem is with phone numbers. Normally, they will be like this in the United States: 0771234560 But if the phone number is from a foreign country, it would look like this. +94771234560 or maybe (22)772324000 Now there are + and () signs to deal with! I am currently converting phone numbers (VCards contain them as Strings) to numbers. However, if I take allow phone numbers as strings, then a user could do something crazy, like insert

vCard .vcf file download browser support - godaddy [closed]

本秂侑毒 提交于 2019-11-30 10:48:08
I have a download vCard (.vcf) link on a site. It works locally but not online. Just opens file in browser without downloading. I would rather not have to zip it. Read around and found I need to put this: AddType text/x-vcard .vcf in a .htaccess file. but it's still not working. Am I missing something? The site is hosted with godaddy. One old thread I read somewhere had a guy who made it work but no more info other than the .htaccess bit. As a first step, ask Godaddy whether they support AddType directives and if yes, how. That solution would definitely be preferable. Alternatively, you may be

localising postal / physical address display from database fields

こ雲淡風輕ζ 提交于 2019-11-30 05:03:36
Can anyone point me to a list of international postal / residential / delivery address format templates that use some kind of parseable standard vocabulary for address parts? The ideal list contains a country code then a format using replaceable tokens so I can substitute database address fields into a template to produce something printable in the local format. for example NZ | [first_name] [family_name]\n[company_name]\n[street_address]\n[city] [post_code]\n[country] AU | [first_name] [family_name]\n[company_name]\n[street_address]\n[city]\n[state] [post_code]\n[country] US | etc UK | etc

localising postal / physical address display from database fields

十年热恋 提交于 2019-11-29 07:24:19
问题 Can anyone point me to a list of international postal / residential / delivery address format templates that use some kind of parseable standard vocabulary for address parts? The ideal list contains a country code then a format using replaceable tokens so I can substitute database address fields into a template to produce something printable in the local format. for example NZ | [first_name] [family_name]\n[company_name]\n[street_address]\n[city] [post_code]\n[country] AU | [first_name]

Formatting VCard in PHP

最后都变了- 提交于 2019-11-29 05:21:28
I'm trying to generate a VCard via PHP, and them email it out to the user. I wrote an initial script with hard-coded data, but the end-result will fill in the VCard from MySQL. When viewing the VCard side-by-side with a legitimate VCard (downloaded and tested from another site) they look pretty much identical, but when I try and import my generated VCard it shows up with no data. Actually, if I open it on my phone, it doesn't even recognize that it is a vcard, and instead just sends me to a broken Google Doc. I've borrowed some code from wikipedia for formatting the vcard, and everything seems

Android get vCard data from Intent

时间秒杀一切 提交于 2019-11-28 11:36:01
I use Intent.ACTION_SEND for receiving data in my app. How can I process sending of data type text/x-vcard ? When I use intent.getStringExtra(Intent.EXTRA_TEXT) , it's throws an exception. This worked for me: Uri uri = (Uri) intent.getExtras().get(Intent.EXTRA_STREAM); uri.toString() gave me this: content://com.android.contacts/contacts/as_multi_vcard/2876r7-2A962A902A9045494F35.1957ifcf79ef7e82a0b99%3A2876r8-315551534945354F312D4F35.1957ieb4f1a6b0fcb82b9%3A2876r9-57493D3135452D3D43.1957ief585d48b64784c0%3A2876r10-4F35373D4343474959.1957if0a70009608fae23%3A2876r11-313B3531412F2D432D473135

android vcard string to contact

送分小仙女□ 提交于 2019-11-28 07:47:34
i'm wondering if there's a clean way to import a vcard as an android contact. i have a vcard parser, but mapping each possible vcard field and field type is going to be a painful, bug-prone exercise. is there a better way? an android contact looks suspiciously like a vcard, so i suspect they use vcards internally. there's no public API for this however. an android contact looks suspiciously like a vcard, so i suspect they use vcards internally. I think it's a lot more complicated than using 'vCards internally' especially as vCard is effectively just a text file format making it inefficient to

Where to find a java library to read vcard files? [closed]

巧了我就是萌 提交于 2019-11-28 07:40:37
I need a java library to read vcard files (vcf). A search for Java and vcard yields quite a few results. In particular there's the Mime-Dir-j which is no longer under active development, but may be all you need, and vcard4j which seems to have been dormant for even longer (last release 2003!). ez-vcard supports versions 2.1, 3.0, and 4.0 of the vCard standard, as well as XML-encoded vCards ("xCard" standard), HTML-encoded vCards ("hCard" microformat), and JSON-encoded vCards ("jCard" standard). https://github.com/mangstadt/ez-vcard To read a vCard file, use the Ezvcard.parse() method. Then,

How to get a vCard (.vcf file) into Android contacts from website

六眼飞鱼酱① 提交于 2019-11-28 06:59:36
I'm trying to add a vCard from a web link to the user's contact list on Android 2.2. When I direct the user to .vcf file, all I get is text output in the mobile browser. I have confirmed that the files is being transferred with MIME type text/v-card. This seems like it should be pretty simple to do. Any ideas? Bernd AFAIK Android doesn't support vCard files out of the Box at least not until 2.2. You could use the app vCardIO to read vcf files from your SD card and save to you contacts. So you have to save them on your SD card in the first place and import them afterwards. vCardIO is also

iPhone: how to get safari to recognize a vcard?

隐身守侯 提交于 2019-11-28 06:34:24
I'm trying to create a QR code so that iPhone users can import my address book information. I'm doing this by: putting a VCF (vcard) file on my web server creating a QR image that contains this URL. http://markharrison.net/mh-vcf-small.png This is working on my desktop browser (it opens the vcard with the address book app). On the iPhone, the QR reader successfully tells safari to access the vcard, but then safari complains it does not know how to handle the vcard. I've confirmed that Content-Type: text/x-vcard is being sent. So, my questions: How do I get Safari to recognize my vcard? Is