The file (html or php) containing the web page may be encoded with different character sets, for example ISO-8859-15 or UTF-8.
To see the encoding of a file, type for example :
file -i index.html
To convert a file from an encoding to another, for example from ISO-8859-15 to UTF-8, type :
iconv -f ISO-8859-15 -t UTF-8 mypage_iso.html -o mypage_utf8.html
The encoding may be declared by different ways, from the most prioritary to the less :
header('Content-Type: text/html; charset=ISO-8859-15');or
header('Content-Type: text/html; charset=UTF-8');This instruction must be executed before any displaying.
default_charset = "iso-8859-15"or
default_charset = "utf-8"
AddDefaultCharset ISO-8859-15or
AddDefaultCharset UTF-8Depending on the web server version, this information may be in different places, for example :
<meta charset="ISO-8859-15"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" /> <meta charset="UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Links :