Tag Archives: bom

blog broke? – no its web expressions

agroundEditing my blog php code last night, the blog layout suddenly went all askew. At first, I though it was ShareThis as when it was enabled it sat at the top right of the screen and seemed to be pushing everything down from the top by 16 pixels. The only problem was disabling ShareThis did not solve the problem.

I hacked a fix by setting the margin to -16 pixels which is hardly a long term fix and only fixed some pages. Anyhow, I finally figured it out using the W3C validator tool. Every php file I edited had the 16 pixel problem, but was fine before I edited it. Even if I hadn’t changed anything.

Web Expressions saves the php files as UTF-8+BOM which is not supported for php files. I guess I am using an old version of Web Expressions, as some sites show it is possible to switch this off inside Web Expressions 2. It did not show in my install. Using my old friend, Editplus to resave the files as just UTF-8 solved the problem.

[image credit: mike138]