Sara golemon posted an article in The newsgroup about how to use stream filters in PHP extensions. The reference is as follows:
If all you want to do is use an already implemented one just do this:
Php_stream * stream;
Php_stream_filter * filter;
Zval * arguments = NULL;/* populate this with value (s) appropriate to the filter */
Stream = php_stream_open_wrapper (... blah .....);
Filter = php_stream_filter_create ("filtername", arguments, php_stream_is_persistent (Stream) tsrmls_cc );
/* Or & stream-> writefilters as appropriate */
Php_stream_filter_append (& stream-> readfilters, filter );
/* Of course, in the real world you'll want to check both stream and filter for null as they may have failed to instantiate */
That said, I don't think iconv. * will be any help. It only covers
Base64 _ (EN | de) code () and quoted_printable _ (EN | de) code ().
Filter Implementation is a bit trickier. Take a look
EXT/standard/filters. C for more info on that. If you come up with a UTF
Converter, I'm sure it can be added to the standard set of filters.
-Sara
"L0t3k" <cshmoove @ xxxxxxxxxxxxx> wrote in message
News: 20040823142259.47665.qmail @ xxxxxxxxxxxxxxx
> Can anyone give a hint as to how to use stream filters from an extension?
>
> I have to parse input files which may be in a variety of encodings (mainly
> Utf8), and processing is done internally in utf16.
>
> I noticed that there is an iconv filter, but I havent a clue (even after
> Googling) of how to use it.
>
> L0t3k
--
PHP internals-PHP runtime development mailing list
To unsubscribe, visit: http://www.php.net/unsub.php