mailto: links using percent encoding for UTF-8 encoding, avoiding RFC 2047 encoding, do not work
Checklist
- [X] I have used the search function to see if someone else has already submitted the same bug report.
- [X] I will describe the problem with as much detail as possible.
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:
- mailto:[email protected]?subject=caf%C3%A9
- mailto:[email protected]?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D
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: Анастасия <[email protected]>
Logs
No response
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:
- #2633