The source that gave me the solution was this one: http://hacks.catdancer.ws/emacs-utf8.html
At work I cannot work with GNU/Linux like at home. But I do use emacs for my developments, combined with FTPDrive to access the remote ftp files as if they were a local folder (in the style of curlFTPfs on GNU/Linux).
When creating a file from emacs in that directory and then opening it in the browser, the accents, eñes, etc… were not displayed.
How to fix it:
- Type M-x customize-variable RET auto-coding-alist RET
- Press the first “INS” button (at the top of the page).
- In “File name regexp”, enter
\.php\'
(Backslash dot P H P backslash single-quote). - In “Coding system”, enter
utf-8 - Press the “Save for Future Sessions” button.
As an alternative way of doing it you could add this to your .emacs file:
(setq auto-coding-alist (cons ’(“\.php\’” . utf-8) auto-coding-alist))