[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 16 Jul 2023 09:27:19 -0400 (EDT) |
branch: master
commit c3e3f353b7f1e2cd4e8a05996abedddca075f2d8
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jul 16 15:27:06 2023 +0200
* tp/t/test_utils.pl (test): OUTPUT_PERL_ENCODING should always be set
in converters, so use nly that variables to set output encoding.
---
ChangeLog | 5 +++++
tp/t/test_utils.pl | 19 ++++++-------------
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index aad3bc00ea..b4a8a51332 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-07-16 Patrice Dumas <pertusus@free.fr>
+
+ * tp/t/test_utils.pl (test): OUTPUT_PERL_ENCODING should always be set
+ in converters, so use nly that variables to set output encoding.
+
2023-07-16 Patrice Dumas <pertusus@free.fr>
* tp/t/08misc_commands.t (comment_space_command_on_line): remove
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index c8da99a7b2..2f1ce9afbd 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -1259,22 +1259,15 @@ sub test($$)
if (!open (OUTFILE, ">$outfile")) {
warn "ERROR: open $outfile: $!\n";
} else {
- my $output_file_encoding;
- # FIXME do all the converters implement get_conf? Otherwise
- # the OUTPUT_PERL_ENCODING could ve determined from
- # $format_converter_options->{'OUTPUT_ENCODING_NAME'} using the
- # same code as in Texinfo/Common.pm set_output_encodings
- my $output_perl_encoding =
$converter->get_conf('OUTPUT_PERL_ENCODING');
- if (defined($output_perl_encoding)) {
- $output_file_encoding = $output_perl_encoding;
- } else {
- my $info = $parser->global_information();
- $output_file_encoding = $info->{'input_perl_encoding'}
- if ($info and $info->{'input_perl_encoding'});
- }
+ # Texinfo::Convert::Converter::converter() calls
+ # Texinfo::Common::set_output_encodings, so OUTPUT_PERL_ENCODING
+ # should be set in all the formats converters.
+ my $output_file_encoding =
$converter->get_conf('OUTPUT_PERL_ENCODING');
if (defined($output_file_encoding)
and $output_file_encoding ne '') {
binmode(OUTFILE, ":encoding($output_file_encoding)");
+ } else {
+ warn "WARNING: $self->{'name'}: $test_name: $format: no
encoding\n";
}
if ($outfile_preamble{$format}) {
if (ref($outfile_preamble{$format}) eq 'CODE') {