Re: Output filters, data encoding

2019-11-14 Thread Damyan Ivanov
-=| p...@cpan.org, 14.11.2019 09:51:20 +0100 |=- > On Wednesday 13 November 2019 20:37:06 Damyan Ivanov wrote: > >my($buffer, $string) = ("", ""); > >while (read($fh, $buffer, 256, length($buffer))) { > >$string .= decode($encoding, $buffer, Encode::FB_QUIET)

Re: Output filters, data encoding

2019-11-14 Thread tomcat/perl
On 14.11.2019 01:09, Hua, Yong wrote: Hi on 2019/11/14 2:12, André Warnier (tomcat/perl) wrote: I'm writing a new PerlOutputFilter, stream version. Can you give a more general introduction for what is "stream version"? Thank you. You shoud read the pages which I referred to previously, they

Re: Output filters, data encoding

2019-11-14 Thread Vincent Veyron
On Wed, 13 Nov 2019 19:12:10 +0100 André Warnier (tomcat/perl) wrote: > I also found that calls to binmode in output filters generate a double encoding. Here is a paste of the code of an output filter that adds a menu, some headers and closing tags to the html pages generated by previous modul

Re: Output filters, data encoding

2019-11-14 Thread pali
On Wednesday 13 November 2019 20:37:06 Damyan Ivanov wrote: > -=| André Warnier (tomcat/perl), 13.11.2019 19:12:10 +0100 |=- > > while (my $sz = $f->read(my $buffer, BUFF_LEN)) { > > .. > > > > and then I need to pass this data to another module for processing > > (Template::Toolkit). > > To

Re: Output filters, data encoding

2019-11-14 Thread pali
On Wednesday 13 November 2019 20:10:07 André Warnier (tomcat/perl) wrote: > On 13.11.2019 19:53, p...@cpan.org wrote: > > On Wednesday 13 November 2019 19:52:25 André Warnier (tomcat/perl) wrote: > > > On 13.11.2019 19:17, p...@cpan.org wrote: > > > > On Wednesday 13 November 2019 19:12:10 André Wa

Re: Output filters, data encoding

2019-11-13 Thread Hua, Yong
Hi on 2019/11/14 2:12, André Warnier (tomcat/perl) wrote: I'm writing a new PerlOutputFilter, stream version. Can you give a more general introduction for what is "stream version"? Thank you.

Re: Output filters, data encoding

2019-11-13 Thread tomcat/perl
On 13.11.2019 19:37, Damyan Ivanov wrote: -=| André Warnier (tomcat/perl), 13.11.2019 19:12:10 +0100 |=- while (my $sz = $f->read(my $buffer, BUFF_LEN)) { .. and then I need to pass this data to another module for processing (Template::Toolkit). To make a long story short, Template::To

Re: Output filters, data encoding

2019-11-13 Thread tomcat/perl
On 13.11.2019 19:53, p...@cpan.org wrote: On Wednesday 13 November 2019 19:52:25 André Warnier (tomcat/perl) wrote: On 13.11.2019 19:17, p...@cpan.org wrote: On Wednesday 13 November 2019 19:12:10 André Warnier (tomcat/perl) wrote: My question is : can I - and how -, set the filehandle that co

Re: Output filters, data encoding

2019-11-13 Thread pali
On Wednesday 13 November 2019 19:52:25 André Warnier (tomcat/perl) wrote: > On 13.11.2019 19:17, p...@cpan.org wrote: > > On Wednesday 13 November 2019 19:12:10 André Warnier (tomcat/perl) wrote: > > > My question is : can I - and how -, set the filehandle that corresponds to > > > the $f->read(),

Re: Output filters, data encoding

2019-11-13 Thread tomcat/perl
On 13.11.2019 19:17, p...@cpan.org wrote: On Wednesday 13 November 2019 19:12:10 André Warnier (tomcat/perl) wrote: My question is : can I - and how -, set the filehandle that corresponds to the $f->read(), to a UTF-8 layer ? I have tried line 155: binmode($f,'encoding:(UTF-8)'); Hi André! Wh

Re: Output filters, data encoding

2019-11-13 Thread Damyan Ivanov
-=| André Warnier (tomcat/perl), 13.11.2019 19:12:10 +0100 |=- > while (my $sz = $f->read(my $buffer, BUFF_LEN)) { > .. > > and then I need to pass this data to another module for processing > (Template::Toolkit). > To make a long story short, Template::Toolkit misinterprets the data I'm >

Re: Output filters, data encoding

2019-11-13 Thread pali
On Wednesday 13 November 2019 19:12:10 André Warnier (tomcat/perl) wrote: > My question is : can I - and how -, set the filehandle that corresponds to > the $f->read(), to a UTF-8 layer ? > I have tried > > line 155: binmode($f,'encoding:(UTF-8)'); Hi André! When specifying PerlIO layer for file