From: mail at eworm.de (Christian Hesse)
Subject: [PATCH 1/1] fix UTF-8 with email-gravatar.py
Date: Tue, 14 Jan 2014 11:11:23 +0100 [thread overview]
Message-ID: <1389694283-31698-1-git-send-email-mail@eworm.de> (raw)
---
filters/email-gravatar.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/filters/email-gravatar.py b/filters/email-gravatar.py
index f90b87d..5d08ea8 100755
--- a/filters/email-gravatar.py
+++ b/filters/email-gravatar.py
@@ -20,6 +20,7 @@
import sys
import hashlib
+import codecs
email = sys.argv[1].lower().strip()
if email[0] == '<':
@@ -29,6 +30,9 @@ if email[-1] == '>':
page = sys.argv[2]
+sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach())
+sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
+
md5 = hashlib.md5(email.encode()).hexdigest()
text = sys.stdin.read().strip()
--
1.8.5.2
next reply other threads:[~2014-01-14 10:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 10:11 mail [this message]
2014-01-14 12:49 ` Jason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389694283-31698-1-git-send-email-mail@eworm.de \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).