google / guava

Google core libraries for Java
Apache License 2.0
50.07k stars 10.86k forks source link

Class to generate mailto: links, perhaps implemented atop a mailtoHeaderFieldEscaper #1301

Open gissuebot opened 9 years ago

gissuebot commented 9 years ago

Original issue created by cpovirk@google.com on 2013-02-26 at 07:43 PM


Something to consider after we finally release the escapers...

We probably want a higher-level interface (like UriParameterMap), but for the moment, I'm just dumping information about the escaping requirements.

The mailto: spec linked to by the WHATWG is here: http://tools.ietf.org/html/rfc6068#section-2

It permits these characters in values:

"!" "$" "'" "(" ")" "*" "+" "," ";" ":" "@" ALPHA / DIGIT / "-" / "." / "_" / "~" (plus percent-encoded characters)

I don't think this matches any of the existing escapers :(

gissuebot commented 9 years ago

Original comment posted by cpovirk@google.com on 2013-02-27 at 05:38 PM


It also says: "Also note that line breaks in the body of a message MUST be encoded with "%0D%0A."" http://tools.ietf.org/html/rfc6068#ref-STD66

David points out that this is arguably a "modification" of input, rather than a mere "escaping," so we might be nervous about it. All the more reason to expose a higher-level interface rather than a raw Escaper :)