I had several HTML files on an Apache server which had special characters. For example, they have © instead of ©. They were working fine but once I migrated those files to a new server (also Apache), all those characters are not properly being displayed in the browser.
I know it’d be better to replace those characters with HTML entities, but as they are thousands of them I just can’t do it in a short period of time. So, my questions are: is there any configuration directive on the Apache server that has to be changed in order to server those files correctly? Can it be solved by changing the HTML meta headers?
Edit
Geert has given the correct answer to this kind of problems. Though, in my case there were some files encoded with ISO-8859-1 and the rest encoded with UTF-8. The solution was to convert from ISO-8859-1 to UTF-8, which can be done by using iconv:
iconv --from-code=ISO-8859-1 --to-code=UTF-8 ./from.php > ./to.php
Set the correct encoding in your Apache configuration with the AddDefaultCharset (http://httpd.apache.org/docs/2.0/mod/core.html#adddefaultcharset). E.g., for setting UTF-8 encoding to all documents, one would use:
However, use this directive carefully. It will set the charset of all documents, so you have to make sure that all these documents are encoded the same. If your documents have different encodings, then don’t use this.