Ticket #9127 (new Bug)

Opened 3 years ago

Last modified 17 months ago

Stylesheet registry (portal_css) handles css files with leading Unicode BOM incorrectly (workaround included)

Reported by: kleist Owned by:
Priority: major Milestone: 3.3.x
Component: Infrastructure Keywords:
Cc:

Description

Plone 3.2.2

I've spent uncountable hours with this quite subtle issue, sometimes doubting my understanding of css, and sometimes my general mental health...

This article really says it all:

 http://codeclimber.net.nz/archive/2007/09/07/Beware-the-Unicode-Byte-Order-Mark-when-merging-files.aspx

(ín its first sentence "Every Unicode string starts with a zero-width no-break space", "string" should of course be "file".)

I've encountered exactly the described symptom: The first rule in every css file was ignored, unless checkmarking "Debug/Development mode" in portal_css. In my case, I'm creating the css files with "Microsoft Expression Web". This program adds a BOM at the start of every file, which is perfectly fine according to the Unicode standard ( http://unicode.org/faq/utf_bom.html#bom5).

I could work around the issue by beginning each css file with a dummy rule:

.workaround-bug-in-plone-portal_css {
}

Attachments

utf8-bom-merge.txt Download (3.8 KB) - added by kleist 2 years ago.
Snapshot of article text explaining the issue

Change History

Changed 2 years ago by kleist

Snapshot of article text explaining the issue

comment:1 Changed 18 months ago by kleist

Here a MSDN document about "Microsoft Expression Web" and BOM:  http://msdn.microsoft.com/en-us/library/cc295463.aspx

comment:2 Changed 17 months ago by kleist

A user on #plone has reported the same issue with a css file created with gEdit on Linux. So mind you, freetards, this is not just an artefact of being stupid enough to utilize programs from the archfoe Microsoft ;-)

comment:3 Changed 17 months ago by kleist

But wait, there's more... "the same #plone user told " the file is modified from someone using MacOS, i don't know editor name, something like csseditor".

Note: See TracTickets for help on using tickets.