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
Share on other sites

[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
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.