summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2020-09-21 10:39:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-21 19:37:38 (GMT)
commit4f80bc9bc2706b9ef467fab3c53b6815f37b2854 (patch)
treedd097305f3c6822fb56732d2453f462061f453f2 /contrib/mw-to-git
parentdde66eb6f1d29c6b5729b41904eaef69234be07c (diff)
downloadgit-4f80bc9bc2706b9ef467fab3c53b6815f37b2854.zip
git-4f80bc9bc2706b9ef467fab3c53b6815f37b2854.tar.gz
git-4f80bc9bc2706b9ef467fab3c53b6815f37b2854.tar.bz2
remote-mediawiki tests: replace deprecated Perl construct
The use of the encoding pragma has been a hard error since Perl 5.18 (released in 2013). What this script really wanted to do was to decode @ARGV and write out some files with the UTF-8 PerlIO layer. Let's just do that explicitly instead. This explicitly does not retain the previous UTF-8 semantics of the script. The "encoding" pragma had all sorts of global effects (program text being UTF-8, stdin/stdout etc.). But the only thing that was required was decoding @ARGV and writing out UTF-8 data, which is currently facilitated with the "open" pragma. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/mw-to-git')
-rwxr-xr-xcontrib/mw-to-git/t/test-gitmw.pl3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/mw-to-git/t/test-gitmw.pl b/contrib/mw-to-git/t/test-gitmw.pl
index afc4650..71e5b06 100755
--- a/contrib/mw-to-git/t/test-gitmw.pl
+++ b/contrib/mw-to-git/t/test-gitmw.pl
@@ -24,7 +24,6 @@
use MediaWiki::API;
use Getopt::Long;
-use encoding 'utf8';
use DateTime::Format::ISO8601;
use open ':encoding(utf8)';
use constant SLASH_REPLACEMENT => "%2F";
@@ -222,4 +221,4 @@ my %functions_to_call = (
getallpagename => \&wiki_getallpagename,
);
die "$0 ERROR: wrong argument" unless exists $functions_to_call{$fct_to_call};
-$functions_to_call{$fct_to_call}->(@ARGV);
+$functions_to_call{$fct_to_call}->(map { utf8::decode($_); $_ } @ARGV);