Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12309 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91379 invoked by uid 1010); 23 Aug 2004 17:37:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 83608 invoked by uid 1007); 23 Aug 2004 17:35:37 -0000 Message-ID: <20040823173537.83607.qmail@pb1.pair.com> To: internals@lists.php.net References: <20040823142259.47665.qmail@pb1.pair.com> Date: Mon, 23 Aug 2004 10:35:16 -0700 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 169.229.135.175 Subject: Re: php stream filters From: pollita@php.net ("Sara Golemon") 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 blah 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 at 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" wrote in message news:20040823142259.47665.qmail@pb1.pair.com... > 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