Encoded URL's are Re-Encoded When Clicked

Some of our users here are copying URL's of relevant files [from one of our sites] and pasting them into Excel.

As the need arises, they refer back to the Excel document and click the link to retrieve the document.

When clicked the already-encoded URL's:

https://sub.domain/some/path/to/files/My%20Super%20Long%20File%20Name-Thats%20Already%20Encoded.pdf

Are getting encoded a second time, which result in a URL like:

https://sub.domain/some/path/to/files/My%2520Super%2520Long%2520File%2520Name-Thats%2520Already%2520Encoded.pdf

This naturally won't work because its now literally looking for a file called "My%20Super%20Long%20File%20Name-Thats%20Already%20Encoded.pdf" which of course doesn't exist.


The URL's in Excel appear normal in the cells themselves.
The editing the actual hyperlink confirms its also correct there as well.
The URL's also look normal in the formula bar.

I've reproduced this behavior on multiple company machines: Windows 7 x64 Enterprise SP1 with Office ProPlus 2010 32-bit.

I was also able to reproduce this on vanilla Windows 7 VM's in Hyper-V using Office ProPlus 2010 and 2013.  Although domain joined, they're in an OU with blocked inheritance enabled and no linked GPO's.

I can't figure out where the problem is: Excel, Windows, IIS or something else?


  • Edited by JuliusPIV Saturday, February 21, 2015 12:50 AM
February 21st, 2015 3:42am

Thanks for the reply George Zhao!
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2015 8:44am

Hello,

Thank you for your post.

This is a quick note to let you know that we are performing research on this issue.

Regards,


George Zhao
Forum Support
________________________________________
Come back and mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback on our support, please click "tnfsl@microsoft.com"


February 23rd, 2015 11:51am

Hi,

Ive done a test for this situation, but the url wont change after reopening the file.

1. A pdf file in SharePoint, and the file name contains some spaces which is the same with customers.

2. Input the SharePoint URL into Excel, and each spaces has been replaced by %20

3. Then, I can open the file in IE

4. After I closed the website and excel file, I could open it in IE again and the URL didnt change.

As you mentioned in the ticket Are getting encoded a second time, which result in a URL like, may I know if the re-encoding was done automatically or manually? Based on the test result, it wont encode a second automatically.

  • If it is done manually, the issue should be most likely caused by the space character being encoded twice, because the space character is encoded as %20 as our two url show. However, based on your second url, it turned into %2520, Since the % character is encoded as %25, it should be a result of a double encoded. Actually, URLs need their characters to be in a specific format, ASCII characters, so that browsers can correctly interpret and parse the data. For every ASCII character in URLs, it will be encoded a string starting with %, and % is also an ASCII character in URLs and encoded to %25. If we double encode a URL, which results that every ASCII character in the URL will be encoded a string starting with %25, and that the URL becomes invalid. Therefore, I suggest you name the file using alpha-numeric characters only or do not encode it twice.
  • If it is done automatically, since you have reproduced the issue on multiple machines, could you please help check the following Excel settings in several machines to make comparisons with each other.

Excel Option>Advanced, Scroll to the General section and click Web Options, select Encoding

If it possible, would you mind sharing a test file with me to do a test from my end?

Regards,

Melon Chen

Forum Support

Free Windows Admin Tool Kit Click here and download it now
February 24th, 2015 5:25am

Thanks for the update and testing.

So here's what the process looks like from start to finish:

  1. We receive a bunch of documents, some with and without spaces in the names.
  2. The documents are imported as-is into the eRoom and categorized
  3. The documents are reviewed by a team via the web interface by clicking on each document
  4. The URL of a reviewed document would look like: https://sub.domain/some/path/to/files/My%20Super%20Long%20File%20Name-Thats%20Already%20Encoded.pdf
  5. That URL is copied & pasted into Excel without changing anything
  6. Steps 3, 4 & 5 are repeated as necessary
  7. We end up with an Excel document containing three sheets with 50 or so links, most of which contain spaces, in each sheet.
  8. For all intents and purposes the URL's in Excel look normal.
  9. Later the documents in the Excel document go under further review, and the team clicks the URL in Excel.
  10. The resulting URL in IE appears to have been encoded a second time as all %20's are now %2520.

I can give you a sanitized document.  How do I get it to you?

February 24th, 2015 8:31am

Hi,

Thanks for your further information. Based on the description, I understand that the URLs in Excel look normal but will change in IE under further review.

Could you please help me confirm the following information? Thank you!

  1. Based on your mentioned, the documents are imported as-is into the eRoom and categorized, may I think that all location of the URLs we try to redirect are the same?
  2. Could you please copy these URLs into other apps, such as Word, Outlook on the same machine to check if we get the same situation?
  3. Could you please copy other kind of URLs into the Excel files to check if we get the same situation?

Regarding to the testing from my end, I really appreciate your sharing. To protect your private information, If you dont mind, please you send the it to our email address: ibsofc@microsoft.com directly.  And for the URLs in the file, please make sure they can be accessed from external, thanks again for your cooperation.

Regards,

Melon Chen

Forum Support

Free Windows Admin Tool Kit Click here and download it now
February 25th, 2015 2:24am

Thanks for the excellent response Melon Chen!

First I'll try to address your questions:

  1. The URL's aren't all the same, namely because it depends on which case and category the document was imported into.  (e.g.: for all correspondence documents for the Microsoft client, it might be http://server/microsoft/correspondence; for common claims it might be http://server/microsoft/com_claims etc.)
  2. I have copied the URLs from Excel and pasted them into Word, Outlook, OneNote, Notepad, Evernote, Notepad++ (and so on).  I click on the resulting link, for the apps that support hyperlinks, and can reproduce the problem.  For apps that don't, I copy them from the app and paste into the browser and can reproduce the problem.  I've even gone as far as creating a shortcut (.url) to the file, and that also fails.

  3. Other URL's copied into Excel (and the rest of the office suite) work.  I've tried several permutations: with and without spaces, encoded and non-encoded, mix & match of the aforementioned.  All work fine.  These URLs however are not referencing files from the eRoom, and that I think is key.


I did some more testing recently and I think I've nailed it:  This problem is either unique to the eRoom software, or the IIS server on which is serving it up.  While I suspect the former, I've yet to 'prove it out', but consider this:

  1. I click the link from Excel (or Word, or Outlook whatever
  2. IE launches, takes me to the eRoom login page
  3. The URL in the browser still looks normal.
  4. I login and immediately the URL has been re-encoded so I get a 404.
  5. I click the back button
  6. The URL is normal (again, %20 not double encoded) but I get a page full of junk.  (Like its trying to give me the ASCII bits of the PDF file itself instead of displaying the file.)
  7. I press F5 at that point, it loads the PDF

However, if I open IE first, authenticate to the eRoom THEN click the links, it works about 90% of the time.  (Some links work all the time, others not so much - not sure why.)

I've opened a ticket with EMC for eRoom as I think I've done all I can to rule out the Excel as the culprit.

  • Marked as answer by JuliusPIV 15 hours 36 minutes ago
February 27th, 2015 2:37pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics