How to encode URL for ms-word app scheme

Nicolas Catallo 0 Reputation points
2023-06-18T20:40:18.96+00:00

Hi,

I am currently trying to open a file from my app using the word app scheme.

For some reason, some URLs are working and other don't. I assume that the issue is linked to the encoding of the file URL.

Here an URL that doesn't work :

Not encoded : ms-word:ofe|u|/storage/emulated/0/Download/interv_app/L0000927/pj/L0000927_L0000023_l'icône accentué_1684664798.docx|a|App

Encoded : word:ofe%7Cu%7C/storage/emulated/0/Download/interv_app/L0000927/pj/L0000927_L0000023_l'ic%C3%B4ne%20accentu%C3%A9_1684664798.docx%7Ca%7CApp

Here a working URL :

Not encoded : ms-word:ofe|u|/storage/emulated/0/Download/interv_app/L0000927/pj/L0000927_L0000021_L0003880_1629452491.docx|a|App

Encoded: ms-word:ofe%7Cu%7C/storage/emulated/0/Download/interv_app/L0000927/pj/L0000927_L0000021_L0003880_1629452491.docx%7Ca%7CApp

My question is, what characters should be encoded and how ?

Thanks in advance for your help.

Nicolas

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Word | For business | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. John Korchok 6,126 Reputation points
    2023-06-19T00:08:38.1366667+00:00

    There is no published list. When in doubt, encode more rather than less. A fully encoded URL should still work.


  2. Nicolas Catallo 0 Reputation points
    2023-06-21T18:04:06.3+00:00

    I found out that the special chars like "é" or "'" or "ô" can be kept like this in URL. Also if I URL encode them it doesn't work anymore.

    However space is the char that make it unable to open the link. When I replace the space by any char it works.

    However I do not have the control about the spaces on filename as I synch those from an app API.

    When I try to replace the space by %20 it doesn't work.

    Can someone help me with that ?

    Thanks a lot !


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.