|
Posted by R on 07/24/06 15:55
Hi All,
I'm using UTF-8 encoding for my PHP scripts, output is also UTF-8.
all files have UTF-8 BOM: 0xEF 0xBB 0xBF at the beginning
I have PHP Version 5.1.2 on WinNT and PHP 5.1.1 on Gentoo
given code:
if (PHP_OS == 'WINNT')
{
header('Content-Type: text/plain; charset=UTF-8"');
var_dump(setlocale(LC_ALL, 'polish_Poland'));
echo mb_strtoupper("aesz", 'utf-8');
}
else
{
// this won't work BOM was sent -> headers were sent
header('Content-Type: text/plain; charset=UTF-8"');
var_dump(setlocale(LC_ALL, 'pl_PL.utf8'));
echo mb_strtoupper("aesz", 'utf-8');
}
the output is:
WinNT:
string(18) "Polish_Poland.1250"
AESZ
Linux Gentoo:
Warning: Cannot modify header information - headers already sent by
(output started at /home/xh/public_html/test.php:1) in
/home/rr/public_html/test.php on line 25
string(10) "pl_PL.utf8" AESZ
mb_strtoupper works fine on both systems but what about
PHP complaining about UTF-8 BOM when trying to send headers on
Gentoo...
on WinNT I have a newer version of PHP...
is this error showing up because on Gentoo I use older PHP5?
thanks in advance for any help
best regards
R
[Back to original message]
|