PDA

View Full Version : Include a php page with special caracters (UTF-8)



Neuhaus3000
June 8th, 2009, 05:04 PM
Hello all,

I'm trying to include a php page with special characters.

My page is encoded with UTF-8
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

I use this script to include the php page
<?php include("_nav_fr.php"); ?>

In my include page I have :
<li<?php if ($thisPageFR=="À propos")echo " id=\"currentpage\""; ?>><a href="#">À propos</a></li>

In a browser, the "À" is more like a "?" with a grey losenge... :puzzled:

Any help will be appreciated.

Thanks! :thumb2:

neuhaus3000

Digitalosophy
June 8th, 2009, 09:35 PM
You could just use an .htaccess file and call it a day. Also you can do it for entire directories opposed to having it in your code itself.



AddDefaultCharset UTF-8

Neuhaus3000
June 10th, 2009, 10:05 AM
Hello Digitalosophy,

I have added the .htaccess file with AddDefaultCharset UTF-8 in it
in the folder where the .php files are but it doesn't seem to work.
any ideas?

Thanks! :thumb:

neuhaus3000

Digitalosophy
June 10th, 2009, 10:41 AM
interesting, can you post a link?