summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/git-remote-mediawiki.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-03 19:06:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-03 19:06:44 (GMT)
commite3798318b12502ae13a8e35e4a385665e810047f (patch)
treed8fb6d6d05afc33a7ad37b54ef9caf142da46a63 /contrib/mw-to-git/git-remote-mediawiki.perl
parent59e0821a81fd82e8aafb8a581d2f001a4ec3e33d (diff)
parent9742fb7e53b2f3bd85b5f01e563aee2cad7e77b8 (diff)
downloadgit-e3798318b12502ae13a8e35e4a385665e810047f.zip
git-e3798318b12502ae13a8e35e4a385665e810047f.tar.gz
git-e3798318b12502ae13a8e35e4a385665e810047f.tar.bz2
Merge branch 'mm/mediawiki-encoding-fix'
* mm/mediawiki-encoding-fix: git-remote-mediawiki: fix encoding issue for UTF-8 media files git-remote-mediawiki: allow stop/start-ing the test server
Diffstat (limited to 'contrib/mw-to-git/git-remote-mediawiki.perl')
-rwxr-xr-xcontrib/mw-to-git/git-remote-mediawiki.perl7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index 3f8d993..8dd74a9 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -461,7 +461,12 @@ sub download_mw_mediafile {
my $response = $mediawiki->{ua}->get($download_url);
if ($response->code == HTTP_CODE_OK) {
- return $response->decoded_content;
+ # It is tempting to return
+ # $response->decoded_content({charset => "none"}), but
+ # when doing so, utf8::downgrade($content) fails with
+ # "Wide character in subroutine entry".
+ $response->decode();
+ return $response->content();
} else {
print {*STDERR} "Error downloading mediafile from :\n";
print {*STDERR} "URL: ${download_url}\n";