purelymail-issues icon indicating copy to clipboard operation
purelymail-issues copied to clipboard

Encoding problems with Contacts on iOS

Open AntZoo opened this issue 3 years ago • 7 comments

I’ve exported all contacts from Gmail to a vCard and imported them into Purelymail. When I use the web UI, all is fine. The macOS contacts are okay as well. However on iOS the non-UTF characters are all shown as black question marks.

A5FD3DBA-6071-45AA-8ECB-57466E7FFB39

46A724F3-154C-4ECA-9912-54B955A54970

Tried re-adding the CardDAV connection, but no luck.

AntZoo avatar Apr 25 '22 13:04 AntZoo

Here's an example of a card with one "bad" contact.

badcard.vcf.zip

AntZoo avatar Apr 25 '22 19:04 AntZoo

I can take a look at this, but it may have to wait a bit since I don't have an iPhone on hand at the moment and it sounds iOS specific. Did you import from the web UI?

ScottPeterJohnson avatar Apr 26 '22 11:04 ScottPeterJohnson

Sure thing, it does sound like an iOS-specific issue. I'd gladly help debug or something if I can. And yeah, I did import from the web UI, I'm not sure if I can import in any other way, because the Import option for this account is greyed out on the mac.

AntZoo avatar Apr 28 '22 20:04 AntZoo

I don't think it's an iOS-specific issue. I'm getting it on iOS and on Thunderbird as well image

GilOliveira avatar May 18 '22 12:05 GilOliveira

So... I've been playing around with this and it's weird... What happens is that any UTF-8 character that's not ASCII (e.g., ç, á, à, é, ó, emojis...) is getting replaced by the Unicode replacement characters: ��.

However this only happens in some platforms: iOS and Thunderbird that I've tested. The names, however, show up fine on macOS and on the Roundcube web interface. Replacing the characters with the respective UTF-8 characters manually in the unsupported platforms does not fix the issue, as the characters just get replaced back when the device syncs with the server.

It seems that the server is struggling to handle UTF-8 syncing in some devices. This is very weird behaviour, I've never faced anything of the sorts using other CalDAV providers.

I can take a look at this, but it may have to wait a bit since I don't have an iPhone on hand at the moment and it sounds iOS specific. Did you import from the web UI?

@ScottPeterJohnson try to sync contacts with UTF-8 Thunderbird and see if you can see the issue there. I think you don't need an iPhone to see it happen.

Cheers everyone!

GilOliveira avatar Jul 07 '22 19:07 GilOliveira

Unfortunately in the grand tradition of bugs, it works perfectly fine in Thunderbird for me. Can either of you email my support address with your account email? I want to see if any differences show up in CardDAV properties. I suspect it could be as simple as some UTF-8 content type not getting set somewhere.

ScottPeterJohnson avatar Jul 08 '22 08:07 ScottPeterJohnson

Thanks to Gil for emailing me! I think I've nailed down the bug and put in a patch. Essentially, CardDAV as a protocol is always UTF-8 but if this isn't specified in the WebDAV content type, iOS has issues. Webmail wasn't always specifying the UTF-8 character set, but now it should always automatically add the UTF-8 if not specified.

I think if you slightly change then save any corrupted contacts now, they should work properly in the future. Let me know.

ScottPeterJohnson avatar Jul 11 '22 08:07 ScottPeterJohnson