I\'m using PHP include to include a PHP file that has HTML in it. some of the content has french accents and these show up as � on the site. How can this be solved?
I had the same issue with a website for a French hotel.
Changing the charset to "ISO-8859-1" instead of "UTF-8" did the trick.
Example: < form method="post" name="contact" action="send_mail.php" accept-charset="ISO-8859-1" >
What is the charset of the HTML page? It sounds like the charset of the PHP file and the HTML within it differ. You might want to check out:
For more help, please post some code, specifically the doctype which is being output and any calls to PHP charset functions.
If switching the charset doesn't fix it, you can use entities. é
for é, ô
for ô and so on
P.S. 'Il a une erreur avec vôtre email' -> You should say 'Il y a', it's votre not vôtre and email can be translated to 'courriel' :)
Try using
<meta http-equiv="Content-Language" content="fr"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
That happens if the browser thinks your using another encoding than you actually use.
try to add the following in your php file before any html is printed:
header ('Content-type: text/html; charset=utf-8');
// or
header ('Content-type: text/html; charset=iso8859-15');
and add
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- or -->
<meta http-equiv="Content-Type" content="text/html; charset=ISO8859-15" />
between the <head></head>
tags
UPDATE: just saw your update with the file. you need to add header ('Content-type: text/html; charset=utf-8');