[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Give INPUT_FILE_NAME_ENCODING, OUTPUT_FILE_NAME_E
From: |
Gavin D. Smith |
Subject: |
branch master updated: Give INPUT_FILE_NAME_ENCODING, OUTPUT_FILE_NAME_ENCODING priority |
Date: |
Sat, 23 Jul 2022 05:37:36 -0400 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 6be9daf7ee Give INPUT_FILE_NAME_ENCODING, OUTPUT_FILE_NAME_ENCODING
priority
6be9daf7ee is described below
commit 6be9daf7ee2871ca6e3ebddddc1d5057f55d227c
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Jul 23 10:33:33 2022 +0100
Give INPUT_FILE_NAME_ENCODING, OUTPUT_FILE_NAME_ENCODING priority
* tp/Texinfo/Common.pm (@variable_string_settables):
Add LOCALE_ENCODING.
* tp/texi2any.pl: Save locale in LOCALE_ENCODING configuration
variable. Do not set INPUT_FILE_NAME_ENCODING or
OUTPUT_FILE_NAME_ENCODING. Do not provide a UTF-8 default value
for the locale encoding.
* tp/Texinfo/Convert/Converter.pm (encoded_input_file_name),
* tp/Texinfo/Convert/Utils.pm
(expand_verbatiminclude, encoded_output_file_name),
* tp/Texinfo/ParserNonXS.pm (_encode_file_name),
* tp/Texinfo/XS/parsetexi/input.c (encode_file_name):
First check INPUT_FILE_NAME_ENCODING, then the document encoding
if DOC_ENCODING_FOR_INPUT_FILE_NAME is set, and thirdly the locale
encoding saved in LOCALE_ENCODING. Likewise for
OUTPUT_FILE_NAME_ENCODING and DOC_ENCODING_FOR_OUTPUT_FILE_NAME.
(Note that Texinfo::Common::encode_file_name can be called
with an undefined encoding argument, so things will likely work
even if LOCALE_ENCODING ends up being undefined.)
* tp/Texinfo/XS/parsetexi/input.c (locale_encoding),
* tp/Texinfo/XS/parsetexi/api.c, tp/Texinfo/XS/parsetexi/Parsetexi.xs
(set_locale_encoding): New.
* tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser):
Propagate LOCALE_ENCODING setting.
* tp/Texinfo/XS/parsetexi/input.c
(locale_input_file_name_encoding, input_file_name_encoding),
* tp/Texinfo/XS/parsetexi/api.c, tp/Texinfo/XS/parsetexi/Parsetexi.xs
(set_locale_input_file_name_encoding, set_input_file_name_encoding):
Rename.
* tp/tests/formatting/list-of-tests
(manual_include_accented_file_name_latin1_explicit_encoding)
(manual_include_accented_file_name_latin1_use_locale_encoding):
Remove now unnecessary -c DOC_ENCODING_FOR_INPUT_FILE_NAME=0
setting.
(non_ascii_test_epub, non_ascii_test_rawtext): Delete duplicate
COMMAND_LINE_ENCODING setting.
---
ChangeLog | 44 ++++++++++++++++++++++++++++++++++++
tp/Texinfo/Common.pm | 18 +++++----------
tp/Texinfo/Convert/Converter.pm | 16 +++++++------
tp/Texinfo/Convert/Utils.pm | 36 ++++++++++++++++-------------
tp/Texinfo/ParserNonXS.pm | 20 ++++++++--------
tp/Texinfo/XS/parsetexi/Parsetexi.pm | 6 ++++-
tp/Texinfo/XS/parsetexi/Parsetexi.xs | 6 ++++-
tp/Texinfo/XS/parsetexi/api.c | 19 +++++++++++-----
tp/Texinfo/XS/parsetexi/api.h | 4 ++--
tp/Texinfo/XS/parsetexi/input.c | 17 +++++++-------
tp/Texinfo/XS/parsetexi/input.h | 3 ++-
tp/tests/formatting/list-of-tests | 8 +++----
tp/texi2any.pl | 5 +---
13 files changed, 131 insertions(+), 71 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9ba1afb960..fe09013915 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,47 @@
+2022-07-23 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Give INPUT_FILE_NAME_ENCODING, OUTPUT_FILE_NAME_ENCODING priority
+
+ * tp/Texinfo/Common.pm (@variable_string_settables):
+ Add LOCALE_ENCODING.
+ * tp/texi2any.pl: Save locale in LOCALE_ENCODING configuration
+ variable. Do not set INPUT_FILE_NAME_ENCODING or
+ OUTPUT_FILE_NAME_ENCODING. Do not provide a UTF-8 default value
+ for the locale encoding.
+
+ * tp/Texinfo/Convert/Converter.pm (encoded_input_file_name),
+ * tp/Texinfo/Convert/Utils.pm
+ (expand_verbatiminclude, encoded_output_file_name),
+ * tp/Texinfo/ParserNonXS.pm (_encode_file_name),
+ * tp/Texinfo/XS/parsetexi/input.c (encode_file_name):
+ First check INPUT_FILE_NAME_ENCODING, then the document encoding
+ if DOC_ENCODING_FOR_INPUT_FILE_NAME is set, and thirdly the locale
+ encoding saved in LOCALE_ENCODING. Likewise for
+ OUTPUT_FILE_NAME_ENCODING and DOC_ENCODING_FOR_OUTPUT_FILE_NAME.
+ (Note that Texinfo::Common::encode_file_name can be called
+ with an undefined encoding argument, so things will likely work
+ even if LOCALE_ENCODING ends up being undefined.)
+
+ * tp/Texinfo/XS/parsetexi/input.c (locale_encoding),
+ * tp/Texinfo/XS/parsetexi/api.c, tp/Texinfo/XS/parsetexi/Parsetexi.xs
+ (set_locale_encoding): New.
+ * tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser):
+ Propagate LOCALE_ENCODING setting.
+
+ * tp/Texinfo/XS/parsetexi/input.c
+ (locale_input_file_name_encoding, input_file_name_encoding),
+ * tp/Texinfo/XS/parsetexi/api.c, tp/Texinfo/XS/parsetexi/Parsetexi.xs
+ (set_locale_input_file_name_encoding, set_input_file_name_encoding):
+ Rename.
+
+ * tp/tests/formatting/list-of-tests
+ (manual_include_accented_file_name_latin1_explicit_encoding)
+ (manual_include_accented_file_name_latin1_use_locale_encoding):
+ Remove now unnecessary -c DOC_ENCODING_FOR_INPUT_FILE_NAME=0
+ setting.
+ (non_ascii_test_epub, non_ascii_test_rawtext): Delete duplicate
+ COMMAND_LINE_ENCODING setting.
+
2022-07-23 Patrice Dumas <pertusus@free.fr>
Separate information on formatting directly Info files
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index d1dfb949a5..a078ab93f6 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1,6 +1,6 @@
# Common.pm: definition of commands. Common code of other Texinfo modules.
#
-# Copyright 2010-2020 Free Software Foundation, Inc.
+# Copyright 2010-2022 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -108,12 +108,9 @@ my %default_parser_common_customization = (
'DEBUG' => 0, # if >= 10, tree is printed in texi2any.pl after parsing.
# If >= 100 tree is printed every line.
'FORMAT_MENU' => 'menu', # if not 'menu' no menu error related.
- 'DOC_ENCODING_FOR_INPUT_FILE_NAME' => 1, # if true use the document
encoding for input
- # file names encoding, else use
- # INPUT_FILE_NAME_ENCODING
+ 'DOC_ENCODING_FOR_INPUT_FILE_NAME' => 1,
'COMMAND_LINE_ENCODING' => undef, # encoding of command line strings
- 'INPUT_FILE_NAME_ENCODING' => undef, # used for input file encoding if
- # DOC_ENCODING_FOR_INPUT_FILE_NAME is 0
+ 'INPUT_FILE_NAME_ENCODING' => undef, # used for input file encoding
);
# Customization variables obeyed only by the parser, and the default values.
@@ -261,12 +258,8 @@ our %default_converter_customization = (
'DEBUG' => 0,
'TEST' => 0,
'TEXTCONTENT_COMMENT', => undef, # in textcontent format
- 'DOC_ENCODING_FOR_INPUT_FILE_NAME' => 1, # if true use the document
encoding for input
- # file names encoding, else use
- # INPUT_FILE_NAME_ENCODING
- 'DOC_ENCODING_FOR_OUTPUT_FILE_NAME' => 0, # if true use the document
encoding for input
- # file names encoding, else use
- # OUTPUT_FILE_NAME_ENCODING
+ 'DOC_ENCODING_FOR_INPUT_FILE_NAME' => 1,
+ 'DOC_ENCODING_FOR_OUTPUT_FILE_NAME' => 0,
);
# Some are for all converters, EXTENSION for instance, some for
@@ -324,6 +317,7 @@ my @variable_string_settables = (
'JS_WEBLABELS',
'JS_WEBLABELS_FILE',
'KEEP_TOP_EXTERNAL_REF',
+'LOCALE_ENCODING',
'L2H_CLEAN',
'L2H_FILE',
'L2H_HTML_VERSION',
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 1ab0c190ef..0736b94b87 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -1036,17 +1036,19 @@ sub encoded_input_file_name($$)
my $self = shift;
my $file_name = shift;
- if ($self->get_conf('DOC_ENCODING_FOR_INPUT_FILE_NAME')) {
- my $document_encoding;
- $document_encoding = $self->{'parser_info'}->{'input_perl_encoding'}
+ my $encoding;
+ my $input_file_name_encoding = $self->get_conf('INPUT_FILE_NAME_ENCODING');
+ if ($input_file_name_encoding) {
+ $encoding = $input_file_name_encoding;
+ } elsif ($self->get_conf('DOC_ENCODING_FOR_INPUT_FILE_NAME')) {
+ $encoding = $self->{'parser_info'}->{'input_perl_encoding'}
if ($self->{'parser_info'}
and defined($self->{'parser_info'}->{'input_perl_encoding'}));
- return Texinfo::Common::encode_file_name($self, $file_name,
- $document_encoding);
} else {
- return Texinfo::Common::encode_file_name($self, $file_name,
- $self->get_conf('INPUT_FILE_NAME_ENCODING'));
+ $encoding = $self->get_conf('LOCALE_ENCODING');
}
+
+ return Texinfo::Common::encode_file_name($self, $file_name, $encoding);
}
# A wrapper around Texinfo::Utils::encoded_output_file_name() that
diff --git a/tp/Texinfo/Convert/Utils.pm b/tp/Texinfo/Convert/Utils.pm
index 139806c2e3..a9b0501d98 100644
--- a/tp/Texinfo/Convert/Utils.pm
+++ b/tp/Texinfo/Convert/Utils.pm
@@ -204,18 +204,20 @@ sub expand_verbatiminclude($$$)
$input_encoding = $current->{'extra'}->{'input_perl_encoding'}
if (defined($current->{'extra'}->{'input_perl_encoding'}));
- my ($file_name, $file_name_encoding);
- if
($configuration_information->get_conf('DOC_ENCODING_FOR_INPUT_FILE_NAME')) {
- ($file_name, $file_name_encoding)
- = Texinfo::Common::encode_file_name($configuration_information,
- $file_name_text,
- $input_encoding);
+ my $encoding;
+ my $input_file_name_encoding =
$configuration_information->get_conf('INPUT_FILE_NAME_ENCODING');
+ if ($input_file_name_encoding) {
+ $encoding = $input_file_name_encoding;
+ } elsif
($configuration_information->get_conf('DOC_ENCODING_FOR_INPUT_FILE_NAME')) {
+ $encoding = $input_encoding;
} else {
- ($file_name, $file_name_encoding)
+ $encoding = $configuration_information->get_conf('LOCALE_ENCODING');
+ }
+
+ my ($file_name, $file_name_encoding)
= Texinfo::Common::encode_file_name($configuration_information,
$file_name_text,
- $configuration_information->get_conf('INPUT_FILE_NAME_ENCODING'));
- }
+ $encoding);
my $file = Texinfo::Common::locate_include_file($configuration_information,
$file_name);
@@ -314,17 +316,19 @@ sub encoded_output_file_name($$)
my $self = shift;
my $file_name = shift;
- if ($self->get_conf('DOC_ENCODING_FOR_OUTPUT_FILE_NAME')) {
- my $document_encoding;
- $document_encoding = $self->{'parser_info'}->{'input_perl_encoding'}
+ my $encoding;
+ my $output_file_name_encoding = $self->get_conf('OUTPUT_FILE_NAME_ENCODING');
+ if ($output_file_name_encoding) {
+ $encoding = $output_file_name_encoding;
+ } elsif ($self->get_conf('DOC_ENCODING_FOR_OUTPUT_FILE_NAME')) {
+ $encoding = $self->{'parser_info'}->{'input_perl_encoding'}
if ($self->{'parser_info'}
and defined($self->{'parser_info'}->{'input_perl_encoding'}));
- return Texinfo::Common::encode_file_name($self, $file_name,
- $document_encoding);
} else {
- return Texinfo::Common::encode_file_name($self, $file_name,
- $self->get_conf('OUTPUT_FILE_NAME_ENCODING'));
+ $encoding = $self->get_conf('LOCALE_ENCODING');
}
+
+ return Texinfo::Common::encode_file_name($self, $file_name, $encoding);
}
# this requires a converter argument. It is defined here, in order
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index d689f43e7e..fa42797f98 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -1,6 +1,6 @@
-# Parser.pm: parse texinfo code into a tree.
+# ParserNonXS.pm: parse texinfo code into a tree.
#
-# Copyright 2010-2020 Free Software Foundation, Inc.
+# Copyright 2010-2022 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -2026,15 +2026,17 @@ sub _encode_file_name($$)
{
my ($self, $file_name) = @_;
- my ($encoded_file_name, $file_name_encoding);
-
- if ($self->get_conf('DOC_ENCODING_FOR_INPUT_FILE_NAME')) {
- return Texinfo::Common::encode_file_name($self, $file_name,
- $self->{'info'}->{'input_perl_encoding'});
+ my $encoding;
+ my $input_file_name_encoding = $self->get_conf('INPUT_FILE_NAME_ENCODING');
+ if ($input_file_name_encoding) {
+ $encoding = $input_file_name_encoding;
+ } elsif ($self->get_conf('DOC_ENCODING_FOR_INPUT_FILE_NAME')) {
+ $encoding = $self->{'info'}->{'input_perl_encoding'};
} else {
- return Texinfo::Common::encode_file_name($self, $file_name,
- $self->get_conf('INPUT_FILE_NAME_ENCODING'));
+ $encoding = $self->get_conf('LOCALE_ENCODING');
}
+
+ return Texinfo::Common::encode_file_name($self, $file_name, $encoding);
}
sub _save_line_directive
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index 7b67d58f2d..4f60427967 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -134,7 +134,11 @@ sub parser (;$$)
set_DOC_ENCODING_FOR_INPUT_FILE_NAME ($conf->{$key});
} elsif ($key eq 'INPUT_FILE_NAME_ENCODING') {
if (defined ($conf->{$key})) {
- set_locale_input_file_name_encoding ($conf->{$key});
+ set_input_file_name_encoding ($conf->{$key});
+ }
+ } elsif ($key eq 'LOCALE_ENCODING') {
+ if (defined ($conf->{$key})) {
+ set_locale_encoding ($conf->{$key});
}
} elsif ($key eq 'accept_internalvalue') {
set_accept_internalvalue();
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
index da991a590e..29bae99686 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
@@ -110,7 +110,11 @@ void
set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i)
void
-set_locale_input_file_name_encoding (value)
+set_input_file_name_encoding (value)
+ char *value
+
+void
+set_locale_encoding (value)
char *value
void
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 8ff0879676..0cc2c127bb 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -150,8 +150,10 @@ reset_parser (void)
global_documentlanguage_fixed = 0;
doc_encoding_for_input_file_name = 1;
- free (locale_input_file_name_encoding);
- locale_input_file_name_encoding = 0;
+ free (input_file_name_encoding);
+ input_file_name_encoding = 0;
+ free (locale_encoding);
+ locale_encoding = 0;
global_accept_internalvalue = 0;
}
@@ -1110,14 +1112,19 @@ set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i)
doc_encoding_for_input_file_name = i;
}
-/* used if doc_encoding_for_input_file_name is 0 */
void
-set_locale_input_file_name_encoding (char *value)
+set_input_file_name_encoding (char *value)
{
- free (locale_input_file_name_encoding);
- locale_input_file_name_encoding = strdup (value);
+ free (input_file_name_encoding);
+ input_file_name_encoding = strdup (value);
}
+void
+set_locale_encoding (char *value)
+{
+ free (locale_encoding);
+ locale_encoding = strdup (value);
+}
static SV *
diff --git a/tp/Texinfo/XS/parsetexi/api.h b/tp/Texinfo/XS/parsetexi/api.h
index 90987be708..0badce2467 100644
--- a/tp/Texinfo/XS/parsetexi/api.h
+++ b/tp/Texinfo/XS/parsetexi/api.h
@@ -16,8 +16,8 @@ void wipe_values (void);
void reset_context_stack (void);
void set_documentlanguage_override (char *value);
void set_DOC_ENCODING_FOR_INPUT_FILE_NAME (int i);
-void set_locale_input_file_name_encoding (char *value);
-
+void set_input_file_name_encoding (char *value);
+void set_locale_encoding (char *value);
HV *build_texinfo_tree (void);
AV *build_label_list (void);
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index cccce74de8..afa2b57d9b 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -282,7 +282,8 @@ convert_to_utf8 (char *s)
int doc_encoding_for_input_file_name = 1;
-char *locale_input_file_name_encoding = 0;
+char *input_file_name_encoding = 0;
+char *locale_encoding = 0;
/* Reverse the decoding of the filename to the input encoding, to retrieve
the bytes that were present in the original Texinfo file. Return
@@ -292,20 +293,20 @@ encode_file_name (char *filename)
{
if (!reverse_iconv)
{
- if (doc_encoding_for_input_file_name)
+ if (input_file_name_encoding)
+ {
+ reverse_iconv = iconv_open (input_file_name_encoding, "UTF-8");
+ }
+ else if (doc_encoding_for_input_file_name)
{
if (input_encoding != ce_utf8 && input_encoding_name)
{
reverse_iconv = iconv_open (input_encoding_name, "UTF-8");
}
}
- else
+ else if (locale_encoding)
{
- if (locale_input_file_name_encoding)
- {
- reverse_iconv = iconv_open (locale_input_file_name_encoding,
- "UTF-8");
- }
+ reverse_iconv = iconv_open (locale_encoding, "UTF-8");
}
}
if (reverse_iconv && reverse_iconv != (iconv_t) -1)
diff --git a/tp/Texinfo/XS/parsetexi/input.h b/tp/Texinfo/XS/parsetexi/input.h
index 8f82fe04be..4a50814bef 100644
--- a/tp/Texinfo/XS/parsetexi/input.h
+++ b/tp/Texinfo/XS/parsetexi/input.h
@@ -32,6 +32,7 @@ extern SOURCE_INFO current_source_info;
extern int input_number;
extern int doc_encoding_for_input_file_name;
-extern char *locale_input_file_name_encoding;
+extern char *input_file_name_encoding;
+extern char *locale_encoding;
#endif
diff --git a/tp/tests/formatting/list-of-tests
b/tp/tests/formatting/list-of-tests
index c5d330685c..a04f0e1bd3 100644
--- a/tp/tests/formatting/list-of-tests
+++ b/tp/tests/formatting/list-of-tests
@@ -22,10 +22,10 @@ cpp_lines ../../t/input_files/cpp_lines.texi -c
MESSAGE_ENCODING=UTF-8
non_ascii_command_line osé_utf8.texi -c COMMAND_LINE_ENCODING=UTF-8 -c
MESSAGE_ENCODING=UTF-8 -c OUTPUT_FILE_NAME_ENCODING=UTF-8 --html
--split=Mekanïk --document-language=Destruktïw -c 'Kommandöh vâl' -D TÛT -D
'vùr ké' -U ôndef -c 'FORMAT_MENU mînù'
--macro-expand=@OUT_DIR@osé-texinfo.texi --internal-links=@OUT_DIR@intérnal.txt
--css-include çss.css --css-include cêss.css --css-ref=rëf --css-ref=öref
# test for the copying of image with non ascii characters for epub
-non_ascii_test_epub osé_utf8.texi -c COMMAND_LINE_ENCODING=UTF-8 -c
MESSAGE_ENCODING=UTF-8 -c OUTPUT_FILE_NAME_ENCODING=UTF-8 --init epub3.pm -c
'EPUB_CREATE_CONTAINER 0' -c 'COMMAND_LINE_ENCODING UTF-8'
+non_ascii_test_epub osé_utf8.texi -c COMMAND_LINE_ENCODING=UTF-8 -c
MESSAGE_ENCODING=UTF-8 -c OUTPUT_FILE_NAME_ENCODING=UTF-8 --init epub3.pm -c
'EPUB_CREATE_CONTAINER 0'
# check that the output is right when based on @setfilename
-non_ascii_test_rawtext osé_utf8.texi -c COMMAND_LINE_ENCODING=UTF-8 -c
MESSAGE_ENCODING=UTF-8 -c OUTPUT_FILE_NAME_ENCODING=UTF-8 -c
INPUT_FILE_NAME_ENCODING=UTF-8 -c TEXINFO_OUTPUT_FORMAT=rawtext -c
'COMMAND_LINE_ENCODING UTF-8'
+non_ascii_test_rawtext osé_utf8.texi -c COMMAND_LINE_ENCODING=UTF-8 -c
MESSAGE_ENCODING=UTF-8 -c OUTPUT_FILE_NAME_ENCODING=UTF-8 -c
INPUT_FILE_NAME_ENCODING=UTF-8 -c TEXINFO_OUTPUT_FORMAT=rawtext
# check that the output is right when based on input file name
non_ascii_no_setfilename_test_rawtext osé_utf8_no_setfilename.texi -c
COMMAND_LINE_ENCODING=UTF-8 -c MESSAGE_ENCODING=UTF-8 -c
OUTPUT_FILE_NAME_ENCODING=UTF-8 -c INPUT_FILE_NAME_ENCODING=UTF-8 -c
TEXINFO_OUTPUT_FORMAT=rawtext
@@ -36,9 +36,9 @@ non_ascii_no_setfilename_test_rawtext
osé_utf8_no_setfilename.texi -c COMMAND_L
# succeeded for this test not to be skipped
manual_include_accented_file_name_latin1
manual_include_accented_file_name_latin1.texi --info -D 'needrecodedfilenames
Need recoded file names'
-manual_include_accented_file_name_latin1_explicit_encoding
manual_include_accented_file_name_latin1.texi --info -c
DOC_ENCODING_FOR_INPUT_FILE_NAME=0 -c INPUT_FILE_NAME_ENCODING=ISO-8859-1 -D
'needrecodedfilenames Need recoded file names'
+manual_include_accented_file_name_latin1_explicit_encoding
manual_include_accented_file_name_latin1.texi --info -c
INPUT_FILE_NAME_ENCODING=ISO-8859-1 -D 'needrecodedfilenames Need recoded file
names'
# fails to find the latin1 encoded include file as the locale encoding
# of the test suite is utf8
-manual_include_accented_file_name_latin1_use_locale_encoding
manual_include_accented_file_name_latin1.texi --info -c
DOC_ENCODING_FOR_INPUT_FILE_NAME=0 -D 'needrecodedfilenames Need recoded file
names' -c MESSAGE_ENCODING=UTF-8 -c INPUT_FILE_NAME_ENCODING=UTF-8
+manual_include_accented_file_name_latin1_use_locale_encoding
manual_include_accented_file_name_latin1.texi --info -D 'needrecodedfilenames
Need recoded file names' -c MESSAGE_ENCODING=UTF-8 -c
INPUT_FILE_NAME_ENCODING=UTF-8
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 7667345c3c..0d4d3b027a 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -282,8 +282,6 @@ if ($texinfo_dtd_version eq '@' . 'TEXINFO_DTD_VERSION@') {
# code points.
my $locale_encoding = langinfo(CODESET);
$locale_encoding = undef if ($locale_encoding eq '');
-my $file_name_encoding = $locale_encoding;
-$file_name_encoding = 'utf-8' if (not defined($file_name_encoding));
# Used in case it is not hardcoded in configure and for standalone perl module
$texinfo_dtd_version = $configured_version
@@ -300,8 +298,7 @@ my $main_program_set_options = {
'TEXINFO_DTD_VERSION' => $texinfo_dtd_version,
'COMMAND_LINE_ENCODING' => $locale_encoding,
'MESSAGE_ENCODING' => $locale_encoding,
- 'INPUT_FILE_NAME_ENCODING' => $file_name_encoding,
- 'OUTPUT_FILE_NAME_ENCODING' => $file_name_encoding,
+ 'LOCALE_ENCODING' => $locale_encoding
};
# use locale on Windows to set encoding of input file name as
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Give INPUT_FILE_NAME_ENCODING, OUTPUT_FILE_NAME_ENCODING priority,
Gavin D. Smith <=