Re: Re: require() causing strange characters ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 6 Feb 2009 10:11:49 +0100, cr.vegelin@xxxxxxxxx wrote:

> I saved both scripts with ANSI in stead of UTF-8 and the problem is gone.
> So the utf-8 BOM character (Byte Order Mark) caused it.
> Unfortunately my editor has no option to store BOM-free scripts.
> 
> Is it standard that PHP scripts should be saved without a BOM character ?

This is not a PHP matter, unless PHP 6 (which will have
Unicode support) does something with it. PHP 5 just outputs
it as is.

A BOM character is supposed to be the *first* character in
a text stream. Otherwise it should be treated as a
ZERO WIDTH NON-BREAKING SPACE.

<http://unicode.org/faq/utf_bom.html#bom1>

> Test results ...
> If "test.php" (utf8) requires "echo.php" (utf8), page source has "C�testD", 
> size 9
> If "test.php" (ansi) requires "echo.php" (utf8), page source has 
> "CtestD", size 7
> If "test.php" (ansi) requires "echo.php" (ansi), page source has "CtestD", 
> size 6
> 
> The reason for asking is that sometimes "" is displayed on some pages.

That means you've used a utf-8 BOM in a page using an 8-bit
character encoding (eg. iso-8859-1 or similar), or that you
have utf-8 encoded it twice.


/Nisse

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux