[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 20 Feb 2022 16:11:00 -0500 (EST) |
branch: master
commit 0207ce3efba8265c760e4a60a261b8a1de6912dd
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Feb 20 22:10:12 2022 +0100
Change variable/function name, set locale for test.
---
tp/Texinfo/ParserNonXS.pm | 8 ++++----
tp/Texinfo/Translations.pm | 4 ++--
tp/t/test_protect_hashchar_at_line_beginning.t | 5 +++++
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 918ff154ad..0b8a3c1e0c 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -551,12 +551,12 @@ foreach my $canonical_encoding ('us-ascii', 'utf-8',
'iso-8859-1',
sub _encoding_alias($)
{
my $encoding = shift;
- my $enc = find_encoding($encoding);
+ my $Encode_encoding_object = find_encoding($encoding);
my ($perl_encoding, $canonical_output_encoding);
- if (defined($enc)) {
- $perl_encoding = $enc->name();
+ if (defined($Encode_encoding_object)) {
+ $perl_encoding = $Encode_encoding_object->name();
# mime_name() is upper-case, our keys are lower case, set to lower case
- $canonical_output_encoding = lc($enc->mime_name());
+ $canonical_output_encoding = lc($Encode_encoding_object->mime_name());
}
my $canonical_texinfo_encoding;
foreach my $possible_encoding ($encoding, $canonical_output_encoding,
diff --git a/tp/Texinfo/Translations.pm b/tp/Texinfo/Translations.pm
index f7990b29c3..f655863d84 100644
--- a/tp/Texinfo/Translations.pm
+++ b/tp/Texinfo/Translations.pm
@@ -54,7 +54,7 @@ my $strings_textdomain = 'texinfo_document';
# libintl converts between encodings but doesn't decode them into the
# perl internal format. This is only called if the encoding is a proper
# perl encoding.
-sub _encode_i18n_string($$)
+sub _decode_i18n_string($$)
{
my $string = shift;
my $encoding = shift;
@@ -132,7 +132,7 @@ sub gdt($$;$$$)
if (!($encoding and $encoding eq 'us-ascii')) {
if ($perl_encoding) {
Locale::Messages::bind_textdomain_filter($strings_textdomain,
- \&_encode_i18n_string, $perl_encoding);
+ \&_decode_i18n_string, $perl_encoding);
}
}
diff --git a/tp/t/test_protect_hashchar_at_line_beginning.t
b/tp/t/test_protect_hashchar_at_line_beginning.t
index 671100ada4..4293716b73 100644
--- a/tp/t/test_protect_hashchar_at_line_beginning.t
+++ b/tp/t/test_protect_hashchar_at_line_beginning.t
@@ -13,6 +13,11 @@ use Texinfo::Convert::Texinfo;
use Data::Dumper;
+# For consistent error message, use the C locale
+$ENV{LC_ALL} = 'C';
+# also needed for consistent error message
+$ENV{LANGUAGE} = 'C';
+
ok(1);
sub run_test($$$;$)