def compile_vcard_data(persons_data):
    """ Take a person's directory data and create a vcard for that person."""
    pd = persons_data
    s = 'BEGIN:VCARD\n'
    s += 'NAME:directory\n'
    s += 'VERSION:3.0\n'
    s += 'N;CHARSET=utf-8:' + pd['Last Name'] + ';' + pd['First Name'
        ] + ';' + pd['Middle Name'] + ';;' + pd['Suffix'] + '\n'
    if pd['Middle Name'] and pd['Suffix']:
        s += 'FN;CHARSET=utf-8:' + pd['First Name'] + ' ' + pd['Middle Name'
            ] + ' ' + pd['Last Name'] + ' ' + pd['Suffix'] + '\n'
    elif pd['Middle Name'].strip():
        s += 'FN;CHARSET=utf-8:' + pd['First Name'] + ' ' + pd['Middle Name'
            ] + ' ' + pd['Last Name'] + '\n'
    elif pd['Suffix'].strip():
        s += 'FN;CHARSET=utf-8:' + pd['First Name'] + ' ' + pd['Last Name'
            ] + ' ' + pd['Suffix'] + '\n'
    else:
        s += 'FN;CHARSET=utf-8:' + pd['First Name'] + ' ' + pd['Last Name'
            ] + '\n'
    if pd['Job Title']:
        s += 'TITLE;CHARSET=utf-8:' + pd['Job Title']
    if pd['E-mail Address']:
        s += 'EMAIL:' + pd['E-mail Address'] + '\n'
    if pd['Home Street']:
        s += 'ADR;CHARSET=utf-8:;;' + pd['Home Street'] + ';' + pd['Home City'
            ] + ';' + pd['Home State'] + ';' + pd['Home Postal Code'] + '\n'
    if pd['Home Phone']:
        s += 'TEL;TYPE=home:' + pd['Home Phone'] + '\n'
    if pd['Mobile Phone']:
        s += 'TEL;TYPE=cell:' + pd['Mobile Phone'] + '\n'
    if pd['Business Phone']:
        s += 'TEL:' + pd['Business Phone'] + '\n'
    s2 = ''
    if pd['Spouse']:
        s2 += 'Spouse: ' + pd['Spouse'] + '   '
    if pd['Children']:
        s2 += 'Children: ' + pd['Children'] + '   '
    if pd['Notes']:
        s2 += pd['Notes']
    if s2:
        s += 'NOTE;CHARSET=utf-8:' + s2.replace(',', '\\,') + '\n'
    if pd['Photo URL'].strip():
        src = pd['Photo URL'].strip()
        s += 'PHOTO;VALUE=uri:' + src + '\n'
    s += 'END:VCARD\n\n'
    return s
