Doc #52348 [Opn->Csd]: Please document --enable-zend-multibyte configure option
| From: | kalle@php.net | Date: | Sat, 23 Oct 2010 13:20:01 +0000 |
| Subject: | Doc #52348 [Opn->Csd]: Please document --enable-zend-multibyte configure option | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5376@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52348&edit=1
ID: 52348
Updated by: kalle@php.net
Reported by: php-bugs at thequod dot de
Summary: Please document --enable-zend-multibyte configure
option
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.3RC3
-Assigned To:
+Assigned To: kalle
Block user comment: N
New Comment:
Hi, sadly the multibyte mode isn't exposed, so the only way to check for
it is by sniffing phpinfo() which is really hacky. I wrote up a small
script for you to see what I mean by hacky:
<?php
$zend_multibyte = false;
ob_start();
phpinfo(INFO_GENERAL);
$buffer = ob_get_clean();
$pos = strpos($buffer, 'Zend Multibyte');
$buffer = substr($buffer, $pos);
if(PHP_SAPI == 'cli')
{
$buffer = ltrim($buffer);
$zend_multibyte = (trim(substr($buffer, 25, strpos($buffer, "\n") -
25)) == 'enabled');
}
else
{
$zend_multibyte = (trim(strip_tags(substr($buffer, 28, strpos($buffer,
"</tr>") - 28))) == 'enabled');
}
unset($buffer, $pos);
var_dump($zend_multibyte);
?>
As for the documentation, I have added a note on the declare()
construct's page that its "impossible" to determine whether the build
have multibyte support or not.
Previous Comments:
------------------------------------------------------------------------
[2010-10-23 15:19:49] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304658
Log: Added remark about zend-multibyte mode, that its only exposed by
phpinfo() (Bug #52348)
------------------------------------------------------------------------
[2010-07-15 17:31:42] php-bugs at thequod dot de
Description:
------------
I could not find (useful) documentation for the "enable-zend-multibyte"
configure option.
It is mentioned to be a requirement for declare(encoding) [1], but
a) apparently the Windows builds do not have it enabled (according to
phpinfo output
b) I cannot see how this can get detected on runtime (e.g. via some
defined function) - I need to know if declare(encoding) processing is
being done or not (and convert source files manually if
declare(encoding) is ignored).
[1] http://php.net/manual/en/control-structures.declare.php
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52348&edit=1