Php, ISO-8859-1

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nico

    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
  • Erwin Moller

    #2
    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="Con tent-Type" CONTENT="text/html; charset=ISO-8859-1">

    Regards,
    Erwin Moller

    Comment

    • Nico

      #3
      Re: Php, ISO-8859-1

      In article <4576bf1c$0$325 $e4fe514c@news. xs4all.nl>,
      Erwin Moller
      <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c omwrote:
      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="Con tent-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

      Comment

      • John Dunlop

        #4
        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.



        --
        Jock

        Comment

        • Michael Fesser

          #5
          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="Con tent-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

          Comment

          • John Dunlop

            #6
            Re: Php, ISO-8859-1

            Michael Fesser:
            [Erwin Moller:]
            >
            <META HTTP_EQUIV="Con tent-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

            Comment

            • John Dunlop

              #7
              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

              Comment

              • malatestapunk

                #8
                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="Con tent-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

                Comment

                Working...