Jump to content

Character Encoding and PhP


Atomg

Recommended Posts

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

  • 3 months later...
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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.