- From: Xidorn Quan <notifications@github.com>
- Date: Sun, 17 Jan 2021 15:25:04 -0800
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Sunday, 17 January 2021 23:25:16 UTC
If you do ```javascript let a = new URL('mailto:test@example.com?subject=Important%20business'); a.searchParams.set('body', 'hello'); console.log(a.href); ``` it would output `mailto:test@example.com?subject=Important+business&body=hello`, noticeably the whitespace `%20` is re-encoded as `+`. While browsers all recognize this encoding, it may not be the case for other clients. The standard spec for `mailto` scheme ([RFC 6068](https://tools.ietf.org/html/rfc6068)), which Email clients generally follow, also doesn't mention `application/x-www-form-urlencoded` anywhere. So it might not be totally safe to do such encoding. I'm not sure what's the right thing to do here. Probably one of: * have RFC 6068 updated to account for `application/x-www-form-urlencoded`, * make the encoding steps vary based on scheme, or at least * add a notice that relying on the encoding may be wrong in some cases. What do you think? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/url/issues/573
Received on Sunday, 17 January 2021 23:25:16 UTC