Atomg Posted June 3, 2006 Share Posted June 3, 2006 I have a question conerning character encoding and php.I have put the line AddDefaultCharset ISO-8859-1 in my .htaccess file as this makes all my page using the correct encoding. My pages are in french so I need é à ù etc. All my html files are ok.But all my .php files are not.Their is two examples where i write ééé ààà êê ù etc. in html and in php I echo ééé ààà êê ù etc.[a href=\"http://beadventure.ca/test/char/index.html\" target=\"_blank\"]The correct webpage in html[/a][a href=\"http://beadventure.ca/test/char/index.php\" target=\"_blank\"]The NON-correct webpage in php[/a]I think its in the configuration of php. I'll need to contact my web host but I don't know what to say. And perhaps their is way without the need to contact them.I'm pretty sure that I can change something on my side (like a line of code or something) because I host a phpBB forum on this website (where phpBB forum is in php... lol =) ) and the é à ù are correctly rendered.I know that I can go in my internet otions and change the encoding by myself, but it's not very nice to do... =(I would like some help on this, thank you for your time everyone. Link to comment https://forums.phpfreaks.com/topic/11112-character-encoding-and-php/ Share on other sites More sharing options...
Atomg Posted June 4, 2006 Author Share Posted June 4, 2006 Is my question too difficult? Should I post it in another forum? Link to comment https://forums.phpfreaks.com/topic/11112-character-encoding-and-php/#findComment-41839 Share on other sites More sharing options...
AndyB Posted June 4, 2006 Share Posted June 4, 2006 [code]<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><html lang="fr"><title>blank page</title></head><body>ééé ààà êê ù etc.</body></html>[/code]Note the language definition Link to comment https://forums.phpfreaks.com/topic/11112-character-encoding-and-php/#findComment-41848 Share on other sites More sharing options...
Atomg Posted September 23, 2006 Author Share Posted September 23, 2006 Andy, you'r solution was not working and I was already trying this.Perhaps their is something missing on my server configuration.However doing the following will ALWAYS work (for me...) (adding the header() at the top)[code]<?php// Default content type (allow àéîö...)header("Content-Type: text/html; charset=ISO-8859-1");?><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><html lang="fr"><title>blank page</title></head><body>ééé ààà êê ù etc.</body></html>[/code] Link to comment https://forums.phpfreaks.com/topic/11112-character-encoding-and-php/#findComment-97243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.