5

I have an .avi file, which is located in a folder in my server. This folder's name has an accent mark. The thing is, when I put that file within a tag, it shows a txt file (the avi files codification, I asume) which obviously is an error. It just happens in Internet Explorer (version 11 at least) with https protocol.

This doesn't happend with mp4 files, neither with avi files which are located in a "non accented folder", neither with http protocol, neither when I paste the address directly in the browser, neither with Chrome or Firefox.

Examples to illustrate what I'm trying to say:

<a href="https://myserver.com/myAccentédFolder/myVid.avi" target="_blank">ERROR</a>
<a href="https://myserver.com/myNonAccentedFolder/myVid.avi" target="_blank">OK 1</a>
<a href="https://myserver.com/myAccentédFolder/myVid.mp4" target="_blank">OK 2</a>
<a href="http://myserver.com/myAccentédFolder/myVid.avi" target="_blank">OK 3</a>

So I know how to "fix" it… but what if I need all the casuistries? - Work with IE 11 - The file to be .avi - The folder to have an accent mark - The address to be within a link - The address to be https protocol

What the %$&$% is going on?

Gabriel Devillers
  • 3,155
  • 2
  • 30
  • 53
D Ie
  • 841
  • 7
  • 23
  • how do you generate the links? you may have to url encode the filename so that it is properly recognized by the browser. you can face such issues with spaces or any special chars in the filename. – Tuckbros Oct 14 '19 at 17:46
  • same link with .mp4 ending insteado of .avi is flawless. Anyway, spaces get encoded as %20, and it's no issue when reloading the url or pasting the url in a new tab/window – D Ie Oct 15 '19 at 06:11
  • You should try to identify as clearly as possible which IE versions show this bug/feature and report a bug to Microsoft. – Gabriel Devillers Oct 16 '19 at 11:41
  • Yes Gabriel, I am sure that Microsoft will bend over this matter ;D – Trueman Oct 20 '19 at 17:38

1 Answers1

2

Good practice is to not use accents in links, if you must, such characters should be given as an ASCII code string to preserve compatibility with browsers and crawlers. Otherwise you can expect that it will not always work as you wish.

In UTF-8 for HTML5 standard %C3%A9 is equivalent to é , therefore your anchor markup should look like this:

<a href="http://myserver.com/myAccent%C3%A9dFolder/myVid.avi" target="_blank">OK 3</a>

note that the browser will change %C3%A9 to é in the address bar (if the browser supports it)

You can find equivalents for many non-standard characters here: https://www.w3schools.com/tags/ref_urlencode.asp

Trueman
  • 274
  • 1
  • 10
  • It does work! Take your well deserved bounty ;) It fixes my issue, anyways, the accent error distinction between .avi and .mp4 is something I'll report to microsoft as @Gabriel said in comments. Thank you all!! – D Ie Oct 21 '19 at 15:17
  • You're welcome and thank you for the bounty - but like I said before, don't expect much from MS;) – Trueman Oct 21 '19 at 17:29