Need Help with Save Format

Discussion in 'HTML & Website Design' started by billybw, Nov 30, 2009.

  1. #1
    I want to convert some old html pages to xhtml transitional. These are simple static pages and I've figured out how to do all parts of the conversion except for one problem. Here it is:

    The instructions say to use a document type definition that specifies utf-8. So when I save the code in NotePad, I thought I should choose utf-8 as the format. But when I try to validate a page at http://validator.w3.org, it validates as xhtml transitional okay, but I also get a warning message about something called a byte order mark (BOM).

    I did some searching and found an article that says that NotePad automatically inserts this BOM in all saved documents. But the warning at http://validator.w3.org says that it might cause problems. Right now I'm having to use a rented computer and don't have any other editors except NotePad. So there's my problem.

    I did some experimenting and found that if I save a page as ANSI instead of utf-8, it passes validation without this warning about a BOM.

    So does anyone know what format I should use to save these pages before I upload them? Can I use ANSI? Or am I suppose to use utf-8, even though I get this warning?

    Thank you
     
    billybw, Nov 30, 2009 IP
  2. jwitt98

    jwitt98 Peon

    Messages:
    145
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You don't need to save your xHTML file in any special format. You just need to define a character set in the head section like this directly after the opening <head> tag:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    Then you will also want to declare the doc type before the head section. Here is the doc type for xHTML transitional:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">


    I would recommend using notepad++ for editing html. It's free to download and it's way better than windows notepad.
     
    jwitt98, Nov 30, 2009 IP
  3. jwitt98

    jwitt98 Peon

    Messages:
    145
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    jwitt98, Nov 30, 2009 IP
  4. billybw

    billybw Peon

    Messages:
    1,012
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the information and link to the article. Very helpful
     
    billybw, Dec 1, 2009 IP