>> Hi,
>>
>> Could you make unicode.semantics configurable at PHP_INI_ALL level?
>
> No.
>
>> Or maybe PHP6 has string functions that are not unicode aware?
>
> All string functions are supposed to be able to work with both Unicode and
> binary strings.
> Unicode is just an addition, it doesn't mean that binary strings are not
> supported anymore, even in Unicode mode.
> But I don't really understand the reason for your question, care to
> provide more details?

SquirrelMail scripts are designed to work with binary strings. They will
have to deal with emails written in many different character sets. In some
cases scripts must know string length in bytes and not in symbols. If PHP
starts converting email body or message parts, strings won't match
information stored in email headers.

If unicode.semantics are turned on, PHP6-dev breaks one time pad creation
and randomizing of mt_rand. crc32, base64_encode and fputs notices and
warnings. "function expects parameter 1 to be strictly a binary string,
Unicode string given". "x character unicode buffer downcoded for binary
stream runtime_encoding". I might provide sample code, if I find the way
to reduce existing code to something simple. Currently I am trying to
understand what exactly is broken in SquirrelMail functions.

I can fix these issues, but one day PHP might add similar checks to
str_replace(), array functions and pcre extension. Then it will break
character set conversion functions and any other code that operates with
8bit strings. Currently I am stuck on broken authentication and can't
check if other parts of interface are already broken.

I could not find the way to disable unicode.semantics in the script.
PHP_INI_PERDIR is not an option for scripts that are designed to be
portable. In some cases end user can't use .htaccess and can't control
php.ini or httpd.conf. mbstring function overloading effects can be
disabled. The way to turn off unicode.semantics is not documented. If
mbstring.func_overload is turned on, I can't trust string functions. Same
thing happens when unicode.semantics are turned on.


-- 
Tomas

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to