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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
..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 |
|
|||
|
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 |
|
|||
|
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 |