A cautionary tail of Byte-Order-Marks (BOMs) and Quirks Mode

A cautionary tail of Byte-Order-Marks (BOMs) and Quirks Mode

by Howard Miller -
Number of replies: 5
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
We've been having a horrible time with a custom theme breaking up on IE8 and IE9 over the last couple of weeks. This weekend I put some time aside to find the problem once and for all.

I won't bother you with all the boring details but suffice it to say that I ended up with two sites with completely identical theme folders and the Anomaly theme (didn't try others) working in one but not in the other.

The difference was a couple of custom blocks that we had sub-contracted out.

It turned out that the dev had obviously used some horrid Windows editor which had added byte-order-makrs (BOMs) to all the block files. This was enough to chuck IE into Quirks Mode and mash the theme. The only requirement was to be logged in, not to have the block displayed (it got even worse with the block displayed).

So... the curse of Microsoft strikes again!!

PS: If you want to know how to check for BOMs in files:

grep -rl $'\xEF\xBB\xBF' *

(which only works on real operating systems.... of course!!)
Average of ratings: Useful (1)
In reply to Howard Miller

Re: A cautionary tail of Byte-Order-Marks (BOMs) and Quirks Mode

by Mary Evans -

Been there done that, baught the 'T' shirt!

Had this problem with a plugin Course Format which is actually in the Plugins Database! Gareth a Dev in Course Format Forum opened MDL-31343 & CONTRIB-3484

Thanks for letting us know. Does this mean Anomily is not to blame? smile

Cheers

Mary

In reply to Mary Evans

Re: A cautionary tail of Byte-Order-Marks (BOMs) and Quirks Mode

by Kevin Wiliarty -

Thank you so much for posting this. You saved me several hours, I'm sure.

In reply to Howard Miller

Re: A cautionary tail of Byte-Order-Marks (BOMs) and Quirks Mode

by Julian Ridden -

Thanks for sharing the tale Howard. I too have seen that movie and sent hours wasted. I think Mary bought the only shirt. smile

Hoping others can spare the time. Of course I don't have that issue. I code on a Mac :P

In reply to Julian Ridden

Re: A cautionary tail of Byte-Order-Marks (BOMs) and Quirks Mode

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I can't afford a Mac sad - so in the mean time I use a PC with Notepad++....

Attachment npp_bom.png
In reply to Gareth J Barnard

Re: A cautionary tail of Byte-Order-Marks (BOMs) and Quirks Mode

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I have never even heard of Byte-Order-Marks and my middle name is Geek.

(actually its Andrew but you know what I mean)