On Thu, 2008-04-17 at 11:11 +0200, Angelo Zanetti wrote:
> 
> -----Original Message-----
> From: Robert Cummings [mailto:[EMAIL PROTECTED] 
> Sent: 17 April 2008 11:05
> To: Angelo Zanetti
> Cc: php-general@lists.php.net
> Subject: RE: [PHP] FRench characters not displayed correctly
> 
> 
> On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote:
> >
> > Thanks Robert, 
> > 
> > I have the following headers:
> > 
> > 
> > http://fr.xxxx.com/student/themes/english/locker_room/student.html
> > 
> > GET /student/themes/english/locker_room/student.html? HTTP/1.1
> > Host: fr.xxxx.com
> > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)
> > Gecko/20080404 Firefox/2.0.0.14
> > Accept:
> >
> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
> > 0.8,image/png,*/*;q=0.5
> > Accept-Language: en-us,en;q=0.5
> > Accept-Encoding: gzip,deflate
> > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> > Keep-Alive: 300
> > Connection: keep-alive
> > Referer:
> http://fr.xxxx.com/student/themes/english/locker_room/student.html
> > Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8
> > If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT
> > If-None-Match: "6b97e-a9d-619b9e80"
> > Cache-Control: max-age=0
> > 
> > HTTP/1.x 304 Not Modified
> > Date: Thu, 17 Apr 2008 08:31:32 GMT
> > Server: Apache/2.0.55 (Unix) PHP/5.1.2
> > Connection: Keep-Alive
> > Keep-Alive: timeout=15, max=200
> > Etag: "6b97e-a9d-619b9e80"
> > -----------------------------
> > 
> > 
> > Now I see that the headers have: 
> > 
> > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> > 
> > Which to me seems like it is sending both ISO-8859-1 and UTF-8? 
> 
> No, that's what kind of content the server is willing to accept from
> various sources such as POST.  You want the following somewhere near the
> beginning of your script:
> 
> <?php
> 
>     header( 'Content-type: text/html; charset=iso-8859-1' );
> 
> ?>
> 
> Cheers,
> Rob.
> ---------------------------------------------------------
> 
> Thanks again, but as far as I have read, it seems that UTF-8 has better
> handling for French characters?
> 
> We have the following in our HTML page: 
> 
> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
> 
> 
> Would the header not conflict with this meta tag?

You can't just change the header or meta tags and expect things to work.
The header must match the type of content you have. The point of th
eheader is to tell the browser what all those multi-byte sequences mean.
If you want to change to UTF-8 and your data is in ISO-8859-1 then you
need to convert the content from one type to the other (I usually use
iconv on the command-line). Until you do so, you should set your header
to whatever content type you have... I'm guessing ISO-8859-1 but maybe
you have UTF-8.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to