InteractionDesignFoundation / add-event-to-calendar-docs

📅 Docs how to generate links to add events to online calendar services
https://interactiondesignfoundation.github.io/add-event-to-calendar-docs/
MIT License
429 stars 57 forks source link

Outlook converts spaces to plus signs (with workaround) #20

Open jerry-knight opened 4 years ago

jerry-knight commented 4 years ago

In Chrome and Firefox, when creating Outlook calendar events using a URL like your example:

https://outlook.live.com/calendar/0/deeplink/compose?path=/calendar/action/compose&rru=addevent&startdt=2020-12-31T19:30:00Z&enddt=2020-12-31T22:30:00Z&subject=Birthday&body=With%20clowns%20and%20stuff&location=North%20Pole

Outlook converts all spaces to plus signs in the subject and body. No amount of encoding the spaces in the URL (%20 vs +) makes any difference.

The only workaround I've found is to convert spaces to thin space. The URL encoding is %E2%80%89, and from my testing, Outlook properly renders the thin spaces. No telling whether it affects other Outlook functions, but it's better than plus signs everywhere.

Additional note: I haven't done extensive browser testing, only Chrome and Firefox. I'm not sure if this issue is browser-dependent.

Pjaerr commented 4 years ago

Hey, I found this issue too, you can encode spaces using new line (%0A) and then use <br/> for any new lines. Not sure if it is better than your solution but it might be useful 👍

SquidDev commented 4 years ago

I've had issues with using <br />, as the message gets truncated after it. However, using the HTML entity for a space (&#32;, or %26%2332; in the URL) does appear to work.

It also appears to work in the title, whereas %0A didn't for me.

jerry-knight commented 4 years ago

I've had issues with using <br />, as the message gets truncated after it. However, using the HTML entity for a space (&#32;, or %26%2332; in the URL) does appear to work.

It also appears to work in the title, whereas %0A didn't for me.

I've verified that this works in the title and body. It doesn't appear to work in the location, but I still think this is a better solution overall than thin spaces. There's no telling how non-standard spaces will affect other Outlook features, like indexing, searching, sharing, etc. I stopped my thin space testing when it looked right in the edit page and calendar view.

Thanks for this solution.

crysislinux commented 3 years ago

It seems that drop rru=addevent could fix the issue. Not sure if there are any other side effects.

webaware commented 3 years ago

Good catch, looks good for strings with spaces encoded as %20 (i.e. not as +)

SpencerRiddering commented 3 years ago

The combination of removing rru=addevent and encoding spaces as %20 works for me.

haveaguess commented 3 years ago

Removing rru=addevent and %20 didnt work for me, issue only occurs on first redirect after login though, subsequent loads if already logged in are ok. %0A worked for me in all cases

haveaguess commented 3 years ago

For line breaks Im finding <br> is working well instead of <br/>

haveaguess commented 3 years ago

Feels like this https://outlook.live.com/calendar/0/deeplink/compose link is broken again?

Maybe this is tapping in at too deep a level and it prone to break?

The OWA level seems to work still

https://outlook.live.com/owa?rru=addevent&startdt=2018-12-06T17%3A00%3A00-05%3A00&enddt=2018-12-06T18%3A00%3A00-05%3A00&subject=Happy%20Hour&location=Boston%2C%20MA&body=Let%27s%20go%E2%80%89after%20work&allday=false&to=ritch%40gmail.com%2Ctestie%2Bcto3%40gmail.com%2Cchloe92%40gmail.com%2Cgamd%40hotmail.com&uid=1616766867211&path=%2Fcalendar%2Fview%2FMonth