Killersites Community:  - BOM characters - Killersites Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

 - BOM characters

#1 User is offline   dina 

  • PipPip
  • View blog
  • Group: New Members
  • Posts: 46
  • Joined: 23-December 08

Posted 03 January 2009 - 03:54 AM

I went to the old forum to read up on BOM, I followed the link and still don't understand how to resolve it. Can anybody please give me a quick selotion for BOM characters at the beginning of my web page please. It seems to me it is blocking any thing after it cause I'm sitting with a blank page in front of me!:o

I have read that people experience this problem if working with php, well I'm working with php if that can help.

thank you
0

#2 User is offline   Ben 

  • View blog
  • Group: Administrators
  • Posts: 5,409
  • Joined: 19-December 08
  • LocationChico, CA

Posted 03 January 2009 - 04:05 AM

What program are you writing your code in?
Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
0

#3 User is offline   Ben 

  • View blog
  • Group: Administrators
  • Posts: 5,409
  • Joined: 19-December 08
  • LocationChico, CA

Posted 03 January 2009 - 04:13 AM

If you are using Notepad, it may be as simple as making sure you are saving it using "ANSI" encoding during the Save As process, rather than "UTF-8" (there is a dropdown in the lower left hand corner of the save as box, just below "Save as Type"
Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
0

#4 User is offline   dina 

  • PipPip
  • View blog
  • Group: New Members
  • Posts: 46
  • Joined: 23-December 08

Posted 03 January 2009 - 04:16 AM

originally I am using notelpad, but I got DWmx demo from a friend so that I can get the feel of it, and still it gave me BOM when I opened it in DW.

But I must add, in the mean while while waiting for a reply I went and opened my php & css in notepad and then resave them both under ANSI insted of UTF-8 and the BOM disappear. I then went back and change it back, and as sure as Hell, there they are again.

I have manage to get my content on css back on my page, cause I was on the wrong level in my link.
0

#5 User is offline   Ben 

  • View blog
  • Group: Administrators
  • Posts: 5,409
  • Joined: 19-December 08
  • LocationChico, CA

Posted 03 January 2009 - 04:17 AM

Quote

I went and opened my php & css in notepad and then resave them both under ANSI insted of UTF-8 and the BOM disappear.

Sounds like that is your solution then -- make sure you are saving them as ANSI rather than UTF-8.
Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
0

#6 User is offline   dina 

  • PipPip
  • View blog
  • Group: New Members
  • Posts: 46
  • Joined: 23-December 08

Posted 03 January 2009 - 04:29 AM

great minds think alike, just want to know if I do save as ANSI will it affect my PHP?
0

#7 User is offline   Ben 

  • View blog
  • Group: Administrators
  • Posts: 5,409
  • Joined: 19-December 08
  • LocationChico, CA

Posted 03 January 2009 - 04:30 AM

Quote

great minds think alike, just want to know if I do save as ANSI will it affect my PHP?


No, it shouldn't affect your PHP at all (well, with the exception of removing the symbols from displaying of course). It won't change any functionality though.
Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
0

#8 User is offline   dina 

  • PipPip
  • View blog
  • Group: New Members
  • Posts: 46
  • Joined: 23-December 08

Posted 03 January 2009 - 04:38 AM

ok thanks Ben, could you then shortly define the diff. between ANSI vs. UTF-8 cause I'm sure I read somewhere that we have to save php files with UTF-8. :/
0

#9 User is offline   Ben 

  • View blog
  • Group: Administrators
  • Posts: 5,409
  • Joined: 19-December 08
  • LocationChico, CA

Posted 03 January 2009 - 04:54 AM

"The first step you will have to take is to give up Notepad. Notepad has a bug (OK, not strictly a bug, but a very undesireable feature). When saving as Unicode (utf-8), it adds a byte-order mark, which is a zero-width space used to indicate the file contents and whether UTF-16 is "little-endian" or "big-endian" (waaay off-topic for this post!). A BOM is not required in utf-8 and should never be used on the web. Notepad will break your utf-8 pages, sometimes to the extent that you will need a hex editor to fix them.

If you use a web-friendly text editor then just select utf-8 and save away. You may need to convert older files, and it is best to be consistent and save as utf-8 everywhere. Don't forget that one big advantage of utf-8 is that it is ASCII-compatible, so the transition is easy. "
http://www.webmaster...rum21/11759.htm

That seems to indicate that it is an issue with the way that Notepad saves files... though I can save as UTF-8 in Notepad and it seems to work fine for me, no BOM displays. Odd. The post is old though, so maybe it's no longer applicable.

I don't fully understand the difference between ANSI and UTF-8 myself... Basically, it seems like they are different character sets that allow you to save a range of characters, and UTF-8 is preferred, since it can store more characters. Someone may have to help me with me explanation here -- I checked Wikipedia but most of it is very technical and went over my head.

The point is, it sounds like UTF-8 is the way to go, maybe just don't use notepad to save the files. I wouldn't usually suggest using Notepad anyway, at least go with a text editor that has tabs and code highlighting and such.
Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
0

#10 User is offline   dina 

  • PipPip
  • View blog
  • Group: New Members
  • Posts: 46
  • Joined: 23-December 08

Posted 03 January 2009 - 05:40 AM

thanks, I do understand much better now. Is there any FREE basic-good editor you suggest that I can download.
0

#11 User is offline   youngros 

  • PipPipPipPip
  • View blog
  • Group: Member
  • Posts: 114
  • Joined: 23-December 08
  • LocationMadeira, Portugal

Posted 03 January 2009 - 09:30 AM

Notepad++ which I use and also HTML-Kit, which I have but not tried out yet.
0

#12 User is offline   Ben 

  • View blog
  • Group: Administrators
  • Posts: 5,409
  • Joined: 19-December 08
  • LocationChico, CA

Posted 03 January 2009 - 11:56 AM

Quote

Notepad++ which I use and also HTML-Kit, which I have but not tried out yet.


I second that -- Notepad++ is quite good.
Benjamin Falk | Falken Creative : Twitter : KillerSites Screencast Blog
Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter
0

#13 User is offline   dina 

  • PipPip
  • View blog
  • Group: New Members
  • Posts: 46
  • Joined: 23-December 08

Posted 04 January 2009 - 12:58 AM

Thanks guys! Downloaded it.
0

#14 User is offline   Stormz 

  • View blog
  • Group: New Members
  • Posts: 5
  • Joined: 28-May 09

Posted 11 June 2009 - 11:44 PM

Notepad++ is the answer to all your BOM pains :)

For some reason, with Dreamweaver (and maybe other editors), the BOM (Byte Order Mark) is introduced when you have not asked it to be... and only on some pages. It's a bug. Problem is, the bug makes your page invalid to W3C standards. The DW validation tool won't pick this up

Download and install the free Notepad++.
http://notepad-plus....net/uk/site.htm

Whenever the W3C validator throws up the BOM error, just open up the file in Notepad++, click on the 'Format' option, tick 'encode in UTF-8 without BOM' and then save your file. The BOM is taken out and your page is valid again.
0

#15 Guest_ashim

  • Group: Guests

Posted 06 May 2010 - 08:07 AM

That seems to indicate that it is an issue with the way that Notepad saves files... though I can save as UTF-8 in Notepad and it seems to work fine for me, no BOM displays. Odd. The post is old though, so maybe it's no longer applicable.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users