Understanding BOM ()

Discussion in 'HTML & Website Design' started by J8Diamonds, Nov 6, 2007.

  1. #1
    Can anybody help me figure out why I get the BOM symbols at the start of my HTML and what I'm doing wrong in general?

    All my site currently consists of is a bg image, header banner on top of bg image, html (which validates), css which validates and lightbox2 js + images.

    I saved all the code in notepad as UTF-8, but when I upload the html using CuteFTP it adds the BOM to the start.

    The site only displays correctly in FF, except if I remove the BOM marks or take out the line
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    it messes up too and shows fragmented background image.

    I've changed the encoding type to both w/ and w/o BOM, but it doesn't seem to make a difference, if I save the HTML in notepad as ANSI or unicode doesn't make a difference either. If I save it without
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    initially it doesn't help. So I'm stumped.

    If you think you can and you'd like to help please pm me for the URL.

    Thanks.
     
    J8Diamonds, Nov 6, 2007 IP
  2. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Try a different text editor? Really, who uses Notepad these days? Unproductive, IMO. If you're into learning, I suggest you try VIM. Otherwise, something like editpad would do.
     
    soulscratch, Nov 6, 2007 IP
  3. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Notepad2 all the way! It's awesome.
     
    twistedspikes, Nov 6, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ok, let's try a couple of things here (in the order I say). Change the declared character encoding in your META tag from ISO-8859-1 to UTF-8 (or UTF-16), save it with that encoding, open up CuteFTP and see if it has the option to either include or exclude the BOM (if it does, choose exclude), and then check to see that your server is really sending the page as UTF-8 (or UTF-16, depending on how the page was saved) instead of something else, such as ISO-8859-1.
     
    Dan Schulz, Nov 8, 2007 IP
  5. J8Diamonds

    J8Diamonds Active Member

    Messages:
    354
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Thanks, but I just changed the site.

    I managed to get rid of the BOM by saving it in something other than notepad, however it still duplicated the background and I couldn't fix it so I just moved the body of the page up.

    Thanks again, though.
     
    J8Diamonds, Nov 8, 2007 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Or just restrict your code to 7 bit ASCII with entities, serve as ISO-8859-1 and avoid all the bullshit headaches that UTF-8 is in the first damned place.
     
    deathshadow, Nov 8, 2007 IP