* [PATCH 1/1] fix UTF-8 with email-gravatar.py
@ 2014-01-14 10:11 mail
2014-01-14 12:49 ` Jason
0 siblings, 1 reply; 2+ messages in thread
From: mail @ 2014-01-14 10:11 UTC (permalink / 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-14 12:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-14 10:11 [PATCH 1/1] fix UTF-8 with email-gravatar.py mail
2014-01-14 12:49 ` Jason
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).