Hi Richard, 

Indeed, that is the case - I've included a code that has UTF-8 string contants 
-so I guess the PHP 
parser set the UTF-8 mode to ON so that the returned string to the client has 
the UTF-8 BOM. 

It is not a big issue as the mobile app guys aware of this and make the proper 
3 bytes offset.
Anyhow I was looking for a service to control that behaviour. 



-----Original Message-----
From: Richard Quadling [mailto:rquadl...@gmail.com] 
Sent: Tuesday, April 12, 2011 12:45 PM
To: Eli Orr
Cc: php-general@lists.php.net
Subject: Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile 

2011/4/12 Eli Orr <eli....@logodial.com>:
> Dear PHP Gurus,
> I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB:
> The PHP server adds  utf-8 BOM (UTF-8 Byte Order Mark  - in the 
> beginning of
> UTF-8  files) which
> consists of three bytes: EF BB BF.
> The Mobile App served by the server Does not need that. How can I 
> eliminate it??
> Thanks.
> UTF-8 Byte Order Mark – BOM:
> http://unicode.org/faq/utf_bom.html#BOM
> Best Regards,
> Eli  Orr
> CTO & Founder
> Mimmage.com
> My virtual vCard
> LogoDial Ltd.
> M:+972-54-7379604
> O:+972-74-703-2034
> F: +972-77-3379604
> Plaut 10, Rehovot, Israel
> Email:   eli....@logodial.com
> Skype:  eliorr.com
> -----
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php

Can you show us the PHP script that DOES output the BOM?

Normally, PHP doesn't do this automatically (AFAIK). The main reason being is 
that it is often the case that the BOM appears in the source code file before 
the <?php opening tag, so would block headers (session cookie for example).

If a BOM is being issued by PHP, it is being done programmatically, or is being 
missed due to the initial source code file having the BOM set.

See http://docs.php.net/manual/en/function.session-start.php#102431,
http://docs.php.net/manual/en/function.header.php#95864, etc.

Now. Having said all of that, you may find you are using some sort of output 
buffering and that is setting the BOM after the headers are sent.

But, as it stands, PHP will not be generating the BOM for you.

Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to