Error when linking an .avi file within a folder with an accent mark

Viewed 110

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?

1 Answers

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

Related