git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/5] git-remote-mediawiki: don't "use encoding 'utf8';"

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Jun 26, 2012, 16:04 UTC
Message-ID
<1340726673-25496-3-git-send-email-Matthieu.Moy@imag.fr>
In-Reply-To
<1340726673-25496-1-git-send-email-Matthieu.Moy@imag.fr>
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.
---
 contrib/mw-to-git/git-remote-mediawiki | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki
index a8e6287..ed06ff7 100755
--- a/contrib/mw-to-git/git-remote-mediawiki
+++ b/contrib/mw-to-git/git-remote-mediawiki
@@ -36,11 +36,10 @@
 use strict;
 use MediaWiki::API;
 use DateTime::Format::ISO8601;
-use encoding 'utf8';
 
-# use encoding 'utf8' doesn't change STDERROR
-# but we're going to output UTF-8 filenames to STDERR
+# By default, use UTF-8 to communicate with Git and the user
 binmode STDERR, ":utf8";
+binmode STDOUT, ":utf8";
 
 use URI::Escape;
 use IPC::Open2;
-- 
1.7.11.5.g0c7e058.dirty
Previous: Matthieu MoyNext: Matthieu Moy
Message 5 of 18 in “git-remote-mediawiki: support File: import and export”
  1. 0/5 git-remote-mediawiki: support File: import and exportMatthieu Moy, Jun 26, 2012
  2. 1/5 git-remote-mediawiki: don't compute the diff when getting commit messageMatthieu Moy, Jun 26, 2012
  3. Junio C HamanoJun 26, 2012
  4. Matthieu MoyJun 27, 2012
  5. 2/5 git-remote-mediawiki: don't "use encoding 'utf8';"Matthieu Moy, Jun 26, 2012
  6. 3/5 git-remote-mediawiki: send "File:" attachments to a remote wikiMatthieu Moy, Jun 26, 2012
  7. 4/5 git-remote-mediawiki: split get_mw_pages into smaller functionsMatthieu Moy, Jun 26, 2012
  8. 5/5 git-remote-mediawiki: import "File:" attachmentsMatthieu Moy, Jun 26, 2012
  9. 0/5 git-remote-mediawiki: support File: import and exportMatthieu Moy, Jun 27, 2012
  10. 1/5 git-remote-mediawiki: don't compute the diff when getting commit messageMatthieu Moy, Jun 27, 2012
  11. 2/5 git-remote-mediawiki: don't "use encoding 'utf8';"Matthieu Moy, Jun 27, 2012
  12. 3/5 git-remote-mediawiki: send "File:" attachments to a remote wikiMatthieu Moy, Jun 27, 2012
  13. 4/5 git-remote-mediawiki: split get_mw_pages into smaller functionsMatthieu Moy, Jun 27, 2012
  14. 5/5 git-remote-mediawiki: import "File:" attachmentsMatthieu Moy, Jun 27, 2012
  15. 5/5 git-remote-mediawiki: import "File:" attachmentsMatthieu Moy, Jun 27, 2012
  16. git-remote-mediawiki: import "File:" attachmentsMatthieu Moy, Jul 4, 2012
  17. Junio C HamanoJul 5, 2012
  18. Matthieu MoyJul 5, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.