Re: upgrading the zlib extension to unicode

From: Date: Tue, 25 Jul 2006 22:39:03 +0000
Subject: Re: upgrading the zlib extension to unicode
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-24973@lists.php.net to get a copy of this message
Nuno Lopes wrote:
Hello, So Andrei asked me to upgrade the zlib extension, but I have a few questions I would like to discuss with you:
I'd like to collaborate on this. Besides reimplementing the output handler to use the new API, I planned to upgrade it to something similar like http_encoding_api.
* when receiving an unicode string, what should we do? compress with as-is, prepend a BOM header (and skip it while uncompressing)? (now I'm unsure if PHP/ICU uses utf16 in the machine endianess or not)
I think it should require a binary string.
* when uncompressing, check for a BOM header and return a unicode string if it is present? return always a binary string?
That would make it inconsistent if decoding data from a source other than PHP, thus I'd say--as before--a binary string.
I also have another question, but unrelated with the zlib extension, that is what is a binary string in PHP 6? I think there were some changes on that part (and there isn't the IS_BINARY by now) and I don't really now the difference between a binary string and the old string (aka runtime_encode'd string)
IS_STRING is practically a binary string, AFAICT. Regards, -- Michael

« previous php.internals (#24973) next »