URI encoding in Yahoo email

I have a web application for creating links. I would like it to be easier for users to send the links that they create to others using gmail, yahoo mail, etc. Yahoo mail has a special quirk that I need a workaround for.

If you have a Yahoo email account, follow this link:

http://compose.mail.yahoo.com/?body=http%3A%2F%2Flocalhost%3A8000%2Fpath%23anchor

Note that yahoo redirects to a specific mail server (e.g. http://us.mc431.mail.yahoo.com/mc/compose ). As with the case, it decodes the hexadecimal codes. One of them,% 23, is a hash character that is not legal in the value of the query string parameter. All information after% 23 is lost.

All my links are broken and just using a different character is not an option.

Calling us.mc431.yahoo.com works directly for me, but probably not for all users, depending on their location.

I tried setting html = true | false by putting the url in the html tag. Nothing works. Has anyone got a reliable workaround for this particular quirk?

Note: any server-based workaround is not a starter for me. This should be a link between Yahoo and the end user.

thank

+4
yahoo
Oct 27 '09 at 17:16
source share
4 answers

Here is how I do it:

  • run a window.escape on these characters: & ' " # > < \

  • run a encodeURIComponent in full line

he works for most of my business. although a new line ( \n ) still remains a problem, but I replace \ n with a space in my case, and it worked fine.

+4
Dec 6
source share

I dealt with the same problem for the last couple of hours, and I found a workaround!

If you encode the anchor twice, it will be correctly interpreted by Yahoo. This means a change of% 23 to% 2523 (percentage sign is% 25).

So your URI will be:
http://compose.mail.yahoo.com/?body=http%3A%2F%2Flocalhost%3A8000%2Fpath%2523anchor

The same workaround can be used for ampersand. If you only encode it as% 26, then Yahoo will convert it to "& amp;" which will discard the rest of the message. Same procedure as above, change% 26 to% 2526.

I still have not found a solution to the newline problem (% 0D and% 0A).

+3
Dec 01 '10 at 11:32
source share

For a new line, add a new line as <BR> and encode it twice, it is successfully interpreted as a new line in a new message

+3
Jul 03 2018-11-11T00:
source share

I think you are at the mercy of what the Yahoo server does when it redirects HTTP. It seems like it should keep the URL when redirecting, but that is not the case. However, without knowing their main application, it is difficult to say why this is not so. Perhaps this is just an unintended side effect (or error), or maybe some of the Javascript functions on this page require some finalization with a hash tag.

+1
Oct 27 '09 at 18:26
source share



All Articles