[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
not using OUTPUT_PERL_ENCODING to determine if _stream_encode should enc
From: |
Patrice Dumas |
Subject: |
not using OUTPUT_PERL_ENCODING to determine if _stream_encode should encode |
Date: |
Sun, 18 Feb 2024 14:13:13 +0100 |
Hello,
This is in the new encode once only stream code, so I ask here before
making a change, I could be missing something, Gavin you probably
will have comments/advices.
I do not think that it is a good thing to set OUTPUT_PERL_ENCODING to an
empty string to prevent _stream_encode to encode if a character string
is wanted, as is done in test_utils.pl in convert_to_plaintext if
convert() is called on a Plaintext converter (same for Info). I think
that it should be another information, set in the converter if called
through convert. For two reasons, first OUTPUT_PERL_ENCODING
information could still be needed later on when outputting to a file
(this is the case in test_utils.pl) and second because convert() should
always return a character strings independentely of any customization
information.
A more minor issue, if $self->{'encoding_object'} is not set, it will
be retested for 'output_perl_encoding' value each time _stream_encode is
called. Maybe it would be better to set it to 0 or to undef and test if
(!exists($self->{'encoding_object'})).
If my analysis is ok, should I try to propose some change, or not?
--
Pat
- not using OUTPUT_PERL_ENCODING to determine if _stream_encode should encode,
Patrice Dumas <=