Skip to content

Custom Labels Handling Problem #198

@DiagonalArg

Description

@DiagonalArg

Checklist

  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected app version

1.1.0

Affected Android/Custom ROM version

GrapheneOS

Affected device model

Pixel 7

How did you install the app?

GitHub releases

Steps to reproduce the bug

Create a vCard with custom labels like:

Cell First, Last
"Something; Tricky"

The labels are shown correctly in the app. They are also shown correctly in Stock.

Sharing the card from Stock to a text editor generates a vCard with no labels:

BEGIN:VCARD
VERSION:2.1
N:Last;First;Middle;;
FN:First Middle Last
TEL;:555-1212
TEL;:666-2323
NOTE:Some notes...
END:VCARD

Sharing the card from Fossify produces an error:

Error:
java.lang.illegalArgumentException: Pr...

Selecting a text editor anyway, produces an empty card.

Expected behavior

No error and a valid vCard.

Actual behavior

Error and empty vCard

Screenshots/Screen recordings

image

image

Additional information

The error appears to be caused by the quotation marks in the label for the number 666-2323. Removing those, I am able to export from Fossify as:

BEGIN:VCARD
VERSION:3.0
PRODID:ez-vcard 0.11.3
FN:First Middle Last
N:Last;First;Middle
TEL;TYPE="Cell First, Last":555-1212
TEL;TYPE="Something; Tricky":666-2323
NOTE:Some notes...
END:VCARD

I see that the spec doesn't seem to offer a means of quoting a double quote:

param-value = *SAFE-CHAR / DQUOTE *QSAFE-CHAR DQUOTE

   any-param  = (iana-token / x-name) "=" param-value *("," param-value)

   NON-ASCII = UTF8-2 / UTF8-3 / UTF8-4
     ; UTF8-{2,3,4} are defined in [[RFC3629](https://datatracker.ietf.org/doc/html/rfc3629)]

   QSAFE-CHAR = WSP / "!" / %x23-7E / NON-ASCII
     ; Any character except CTLs, DQUOTE

   SAFE-CHAR = WSP / "!" / %x23-39 / %x3C-7E / NON-ASCII
     ; Any character except CTLs, DQUOTE, ";", ":"

So unless you want to introduce '\"', in a way analogous to the use of '\;' in ORG:Company\;Department , then perhaps there should be a softer failure mode?

Question

What is the internal representation of contacts that allows "Something; Tricky" to be displayed, but not exported?

Also, other questions about the behavior, here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedFeature or bug accepted. PR is welcome.bugSomething is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions