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

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

Howard Miller發表於
Number of replies: 5
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 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!!)
評比平均分數:Useful (1)
In reply to Howard Miller

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

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? 微笑

Cheers

Mary

In reply to Mary Evans

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

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

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. 微笑

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

Gareth J Barnard發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片

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

附件 npp_bom.png
In reply to Gareth J Barnard

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

Marcus Green發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 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)