git-remote-mediawiki: don't "use encoding 'utf8';"
The use of this statement is generally discouraged, and is too intrusive for us: it forces the HTTP requests made by the API to contain only valid UTF-8 characters. This would break the upload of binary files. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy committed
Jun 27, 2012 at 11:10 UTC
721a533f8c9b152b4510569b3b486437d179c773
1 file changed
+2
-3
contrib/mw-to-git/git-remote-mediawiki
+2
-3
@@ -36,11 +36,10 @@
36
use strict;
37
use MediaWiki::API;
38
use DateTime::Format::ISO8601;
39
-use encoding 'utf8';
39
41
-# use encoding 'utf8' doesn't change STDERROR
42
-# but we're going to output UTF-8 filenames to STDERR
40
+# By default, use UTF-8 to communicate with Git and the user
41
binmode STDERR, ":utf8";
42
+binmode STDOUT, ":utf8";
43
44
use URI::Escape;
45
use IPC::Open2;