CakePHP set encoding of a file read in browser
===

I'm using CakePHP 1.3.7 and I'm trying to read a file by clicking on a link.

This actually works; a new tab opens with the text of a file when I click on the link, but when there are special characters in the file, they are not displayed properly

> Test des espaces et des caractÃ¨res spÃ©ciaux

Text should be UTF-8 and should be displayed as follow

> Test des espaces et des caractères spéciaux

I think this question might be related to mine :
http://stackoverflow.com/questions/7681259/browser-detects-iso-8859-1-encoding-on-utf-8-cakephp-app but doesn't seem to be exactly what I'm looking for

Nothing is generated in the head tag of the html code of the new tab but maybe there should be something specifying the charset?

I have considered using Media View instead of opening a new tabulation, but only certain users are allowed to see certain links, so I don't want a download method to be accessible from url and if I built specific permissions to access the download method, they would have to change say everyday (as do the links) so this doesn't seem like the way to go.

Atm I can download the file by right-clicking on the link and when saved locally, the characters are displayed properly when I open it.

Also, what is saved in the database is the filepath, the filename and the mime_type. I don't know if I should use the cakephp File class?

Thanks ~