Tell me more ×  How can I change all of my php/css/js files to
utf character encoding? I can't get it to validate otherwise.
share|improve this question add comment  2 Answers  up vote 1
down vote accepted  Have you tried the .htaccess option
"AddCharset". It should work on the parent directory of where
the .htaccess file is located plus all sub directories.
AddCharset UTF-8 .php  share|improve this answer add comment
You haven't said what encoding the files are in at the moment,
or what operating system you are using. On my Ubuntu system, I
have a command called iconv that will convert a single file.
Using this, I would write a simple script to convert files "in-
place". For example, to convert from iso8859-15 to utf-8, put
this script in /tmp/convert:  iconv -f iso8859-15 -t utf-8 "$1"
> "$1.$$" && mv "$1.$$" "$1"  then run:  chmod 755 /tmp/convert
and then run find to execute that script on all .php, .js and
.css files:  find /my/website/root -name \*.php -o -name \*.js
-o -name \*.css -exec /tmp/conver