Merge branch 'rs/unify-is-branch'
[gitweb.git] / contrib / mw-to-git / git-remote-mediawiki.perl
index 3f8d993afaca53024aa75b4118da9ee80e6a6313..8dd74a9a406e9cfd685ea1af3947e4bea4c82f90 100755 (executable)
@@ -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";