Strange characters generated by ezpublish

Author Message

Kuba Boguslawski

Monday 26 February 2007 2:24:42 pm

Hello

I have changed few templates. Ez generates very strange characters before modified templates - "". Does anybody know what can be wrong? I am using EditPlus

Thanks
Jakub

Claudia Kosny

Tuesday 27 February 2007 12:20:20 am

Hi there

Most likely your editor saves the templates with a BOM (just google it). Found this on the web regarding editplus:

... but it could have something to do with
the Byte Order Mark (BOM). Most web pages don't use the BOM because it
can cause display problems in some browsers. You may want to check to
see that "Support UTF-8 files without Byte Order Mark" checked in the
preferences under "Files".

source: http://tech.groups.yahoo.com/group/editplus/message/4574

Claudia

*- pike

Friday 20 April 2007 3:26:14 pm

yes, "" is the BOM.

http://en.wikipedia.org/wiki/Byte_Order_Mark

...looks like this in a HEX editor:
EF BB BF

There is something with Textpad5 and the BOM,
though I dont really understand what :-)
http://www.textpad.com/support/relnotes.html

I'm fighting with BBEdit and the BOM.
It is outputted whenever I do a

    $bla = $tpl->fetch('bla.tpl');

Note, the character is *outputted* when I do the fetch, even though the result of the fetch is stored in a variable ...

when I change bla.tpl's encodings, things do change (but I can't get rid of the BOM). I only get different BOMs (UTF-16, etc)

hmmmmmmmm
*-pike

---------------
The class eZContentObjectTreeNode does.

Piotrek Karaś

Friday 20 April 2007 11:41:49 pm

Although BOM has it's uses, I've never seen in welcome in web/PHP encoded applications (utf-8 encodings). Always avoid it at all costs, and that can be done by choosing editors which handle it in a controlled way (either remove it altogether or simply keep it only if had been there before). It used to be a problem to find those editors some years ago, but I guess not so much anymore. As stated in the Wiki article, many Windows editors, including notepad, prepend it automatically when they assume a file is UTF-8 encoded.

Another way to remove unnecessary BOMs is to write a simple (PHP) script that searches for it in the application files recursively and removes it, if found. It's a good idea to store the pattern of BOM in an empty UTF-8 file (it will have 3 bytes). Just backup your application beforehand :)

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

florian bellenger

Monday 09 March 2009 3:56:08 pm

hello everybody

Sometimes, when cache is not used, web pages are broken (with ie7). When it happens, there is a BOM at the beginning of the HTML source of the page. I have checked the templates, their format is ANSI.

Maybe there is a file I have forgot to check wich contains the BOM. Is there an other possible explanation ?

(I finally found some files with the BOM.)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.