|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-09-22 13:36 UTC] lapo at lapo dot it
Description:
------------
Zend multibyte option (that ought to automagically detect script file format and read it accordingly) starts working correctly after a few seconds (I tested it only in FastCGI, as I use lighty and not Apache).
Reproduce code:
---------------
File checkUTF8.php (encoded in UTF-8 with explicit BOM, aka UTF-8Y):
\xEF\xBB\xBF<?= ('?' == "\xC3\xA0") ? "OK\n" : "Broken\n" ?>
(the first three chars are the UTF8-encoded BOM)
Expected result:
----------------
% php -r checkUTF8.php
OK
% while true; do elinks -dump 'http://wlocalhost/checkUTF8.php'; sleep 1; done
OK
OK
(lighttpd restarted from a different shell)
ELinks: Connection refused
ELinks: Connection refused
OK
OK
OK
OK
Actual result:
--------------
% php -r checkUTF8.php
Broken
% while true; do elinks -dump 'http://wlocalhost/checkUTF8.php'; sleep 1; done
OK
OK
(lighttpd restarted from a different shell)
ELinks: Connection refused
ELinks: Connection refused
Broken
Broken
OK
OK
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 06:00:01 2025 UTC |
Ah, something changed with 5.2.8 indeed: it now is always broken, doesn't fix after a bit like it did before. A bit more clarity about the test script, an hex dump: % hd checkUTF8.php 00000000 ef bb bf 3c 3f 3d 20 28 27 c3 a0 27 20 3d 3d 20 |<?= ('?' == | 00000010 22 5c 78 43 33 5c 78 41 30 22 29 20 3f 20 22 4f |"\xC3\xA0") ? "O| 00000020 4b 5c 6e 22 20 3a 20 22 42 72 6f 6b 65 6e 5c 6e |K\n" : "Broken\n| 00000030 22 20 3f 3e |" ?>|