got  symbol in browser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • waqasahmed996
    New Member
    • Jun 2008
    • 160

    #1

    got  symbol in browser

    hi to all

    i have a strange problem. when i include php file above html tags then its all right

    but when i include my header (php file) after html tags then i got this symbol
    on browser 

    my code when i got this symbol is

    Code:
    <html>
    <head>
    <title>title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="css/style.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <? include("includes/top.php"); ?>
    please give me some solution. i think i am posting in right category (HTML forum).
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    what encoding has top.php? if it's not latin-1 or ascii, all out-of-range characters are displayed weirdly.

    Comment

    • waqasahmed996
      New Member
      • Jun 2008
      • 160

      #3
      symbol appear even if i wrote nothing in top.php except

      Code:
      <?
      die();
      ?>

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        could be a BOM (Byte Order Mark)

        Comment

        • waqasahmed996
          New Member
          • Jun 2008
          • 160

          #5
          how can i identify if there is any BOM in php

          and how can i remove it

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            open the file in a good editor, select "display invisible characters" the BOM should be appearing at the very beginning (well, depending on the editor), if not write the file new but don't copy the first line. remember to save the file as Latin-1, not UTF-8.

            Comment

            • waqasahmed996
              New Member
              • Jun 2008
              • 160

              #7
              i am using dreamweaver as a editor

              can i identify BOM in dreamweaver

              what could be the other reason other than BOM to show this symbol 

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                Originally posted by waqasahmed996
                can i identify BOM in dreamweaver
                I don't know, but I guess not
                Originally posted by waqasahmed996
                what could be the other reason other than BOM to show this symbol 
                BOM is U+FEFF, a multibyte sign. if you interpret it using Latin-1 (which is not multibyte) the bytestream is interpreted as several characters included in the charset.

                Comment

                • waqasahmed996
                  New Member
                  • Jun 2008
                  • 160

                  #9
                  if i change following code then this symbol could be removed?

                  currently i am using this code

                  Code:
                  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

                  Comment

                  • Dormilich
                    Recognized Expert Expert
                    • Aug 2008
                    • 8694

                    #10
                    Originally posted by Dormilich
                    write the file new but don't copy the first line. remember to save the file as Latin-1, not UTF-8.
                    that should do it (best is you open it using latin-1 as default charset).

                    if all fails, use UTF-8 as encoding (but you need to re-encode the other non-UTF-encoded files). if you're using a DB, check for the content-encoding there first.

                    Comment

                    • waqasahmed996
                      New Member
                      • Jun 2008
                      • 160

                      #11
                      thanks Dormilich. you really provide me great help. my problem is solved by using following code.

                      Code:
                      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                      will other application be effected by using utf-8. actually i am given this task only to remove this symbol. other coding is not done by me. thats why i am asking that php code could be effected by using utf-8

                      Comment

                      • Dormilich
                        Recognized Expert Expert
                        • Aug 2008
                        • 8694

                        #12
                        Originally posted by waqasahmed996
                        will other application be effected by using utf-8.
                        if you're loading data not encoded in utf-8, all (I think so) characters outside the ASCII range will be affected. (e.g. chars in languages like French, German, Spanish, Russian)

                        Comment

                        • drhowarddrfine
                          Recognized Expert Expert
                          • Sep 2006
                          • 7434

                          #13
                          Look at the options in Dreamweaver for saving files. I believe there is an option to select the character encoding to save it in. Nowadays, people should have their html files in utf-8.

                          Comment

                          • Dormilich
                            Recognized Expert Expert
                            • Aug 2008
                            • 8694

                            #14
                            Originally posted by drhowarddrfine
                            Nowadays, people should have their html files in utf-8.
                            unless there are problems your chosen script language or browser has with Unicode.

                            Comment

                            Working...