thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/
Apache License 2.0
10.08k stars 2.47k forks source link

mailto: links using percent encoding for UTF-8 encoding, avoiding RFC 2047 encoding, do not work #6028

Open dilyanpalauzov opened 2 years ago

dilyanpalauzov commented 2 years ago

Checklist

App version

5.807

Where did you get the app from?

F-Droid

Android version

LineageOS

Device model

No response

Steps to reproduce

I click on the html code

<a href="mailto:?to=%D0%90%D0%BD%D0%B0%D1%81%D1%82%D0%B0%D1%81%D0%B8%D1%8F%20%3C1%40example.org%3E">zzz</a>

K9 mail opens, and contains empty TO: field.

If I take the decoded string (Анастасия), first RFC2047 ecnode it, then percent encode it, and click the link, K9 fills the TO: field. My reading of RFC6068 Examples Using UTF-8-Based Percent-Encoding is that both are equivalent:

So it is possible to skip the RFC2047 encoding and use only percent encoding on the UTF-8 data.

Expected behavior

I click on the html code

<a href="mailto:?to=%D0%90%D0%BD%D0%B0%D1%81%D1%82%D0%B0%D1%81%D0%B8%D1%8F%20%3C1%40example.org%3E">zzz</a>

K9 opens and shows empty TO: field.

Actual behavior

K9 mail shall fill To: Анастасия <1@example.org>

Logs

No response

cketti commented 2 years ago

I can confirm that this should work.

For the addresses in a mailto URI we're using the same parser that is used when parsing headers. Currently that parser doesn't support (unencoded) non-ASCII characters.

Related: