Php, ISO-8859-1

This is a discussion on Php, ISO-8859-1 within the PHP Language forums, part of the PHP Programming Forums category; Dear all, I made a php page (charset: ISO-8859-1). When I open this page in my localhost everything ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-06-2006
Nico
 
Posts: n/a
Default Php, ISO-8859-1

Dear all,

I made a php page (charset: ISO-8859-1).
When I open this page in my localhost everything is OK.
On the contrary, if I open the page in my test web-site, I'm not able to
see the correct types (e.g. the symbol of Euro).
If I change the charset (from UTF-8 to ISO-8859-1) by hand in my browser
I see all the types correctly.
I suppose that my apache is not settled correctly.
In the case, do you know what kind of command should I add (or change)?
Many thanks for the help.

Best,
Nico
Reply With Quote
  #2 (permalink)  
Old 12-06-2006
Erwin Moller
 
Posts: n/a
Default Re: Php, ISO-8859-1

Nico wrote:

> Dear all,
>
> I made a php page (charset: ISO-8859-1).
> When I open this page in my localhost everything is OK.
> On the contrary, if I open the page in my test web-site, I'm not able to
> see the correct types (e.g. the symbol of Euro).
> If I change the charset (from UTF-8 to ISO-8859-1) by hand in my browser
> I see all the types correctly.
> I suppose that my apache is not settled correctly.
> In the case, do you know what kind of command should I add (or change)?
> Many thanks for the help.
>
> Best,
> Nico


Hi Nico,

Just add a META-tag to your header in your document describing the
contenttype:

<META HTTP_EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">

Regards,
Erwin Moller
Reply With Quote
  #3 (permalink)  
Old 12-06-2006
Nico
 
Posts: n/a
Default Re: Php, ISO-8859-1

In article <4576bf1c$0$325$e4fe514c@news.xs4all.nl>,
Erwin Moller
<since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:

> Nico wrote:
>
> > Dear all,
> >
> > I made a php page (charset: ISO-8859-1).
> > When I open this page in my localhost everything is OK.
> > On the contrary, if I open the page in my test web-site, I'm not able to
> > see the correct types (e.g. the symbol of Euro).
> > If I change the charset (from UTF-8 to ISO-8859-1) by hand in my browser
> > I see all the types correctly.
> > I suppose that my apache is not settled correctly.
> > In the case, do you know what kind of command should I add (or change)?
> > Many thanks for the help.
> >
> > Best,
> > Nico

>
> Hi Nico,
>
> Just add a META-tag to your header in your document describing the
> contenttype:
>
> <META HTTP_EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
>
> Regards,
> Erwin Moller


Thanks for the suggestion. But I've already done this operation.
The problem is the following. All my web-site is done with UTF-8 and
Apache has UTF-8 defined as default. This new pages are done with
ISO-8859-1 code (now it's quite difficult to explain the reasons). So,
if I open the ISO pages, I'm not able to see correctly the types because
Apache says to my browser to open all the pages as UTF-8. Then, I've to
change manually the code on my browser. I don't know if it's possible to
add some line in my httpd conf, useful to solve this problem. Can you
help me please? Many thanks.

Best,
Nico
Reply With Quote
  #4 (permalink)  
Old 12-06-2006
John Dunlop
 
Posts: n/a
Default Re: Php, ISO-8859-1

Nico:

> I made a php page (charset: ISO-8859-1).
> When I open this page in my localhost everything is OK.
> On the contrary, if I open the page in my test web-site, I'm not able to
> see the correct types (e.g. the symbol of Euro).


U+20AC is not available to ISO-8859-1. ITYM Windows-1252.

http://czyborra.com/charsets/iso8859.html

--
Jock

Reply With Quote
  #5 (permalink)  
Old 12-06-2006
Michael Fesser
 
Posts: n/a
Default Re: Php, ISO-8859-1

..oO(Erwin Moller)

>Just add a META-tag to your header in your document describing the
>contenttype:
>
><META HTTP_EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">


That's rather useless, because the real HTTP header will override it.
Better configure the server to send the appropriate content type.

Micha
Reply With Quote
  #6 (permalink)  
Old 12-06-2006
John Dunlop
 
Posts: n/a
Default Re: Php, ISO-8859-1

Michael Fesser:

> [Erwin Moller:]
>
> ><META HTTP_EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">

>
> That's rather useless, because the real HTTP header will override it.


I wouldn't say useless, not altogether. If HTTP is not used, then
the highest priority way of determining the Content-Type is
unavailable, and the next highest priority way according to HTML4.01 is
the META tag. HTTP would not be used, for example, if a document was
saved and opened later from the filesystem.

> Better configure the server to send the appropriate content type.


Of course! But that doesn't stop you repeating yourself in a META
tag.

--
Jock

Reply With Quote
  #7 (permalink)  
Old 12-06-2006
John Dunlop
 
Posts: n/a
Default Re: Php, ISO-8859-1

John Dunlop:

[a load of drivel]

You were, of course, not referring to the META tag in itself but
rather to the META tag as a solution to this particular problem. Fair
enough! I do beg your pardon, Michael.

--
Jock

Reply With Quote
  #8 (permalink)  
Old 12-07-2006
malatestapunk
 
Posts: n/a
Default Re: Php, ISO-8859-1

You could also send an appropriate header from your script:

<?php header ("Content-Type: text/html; charset=iso-8859-1"); ?>

To be extra safe, I'd keep the META tag in the HTML too.

John Dunlop wrote:
> Michael Fesser:
>
> > [Erwin Moller:]
> >
> > ><META HTTP_EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">

> >
> > That's rather useless, because the real HTTP header will override it.

>
> I wouldn't say useless, not altogether. If HTTP is not used, then
> the highest priority way of determining the Content-Type is
> unavailable, and the next highest priority way according to HTML4.01 is
> the META tag. HTTP would not be used, for example, if a document was
> saved and opened later from the filesystem.
>
> > Better configure the server to send the appropriate content type.

>
> Of course! But that doesn't stop you repeating yourself in a META
> tag.
>
> --
> Jock


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:30 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0