aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-01-14 19:11:23 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-14 21:55:35 (JST)
commit46176eca7f130a59813d160415a5ead58133f128 (patch)
treeb428c8d1ebc032a74b5bf3945b094db57e1a370e
parent50287e7912129881a0157e4ae6dcc42310567c6e (diff)
downloadcgit-46176eca7f130a59813d160415a5ead58133f128.zip
cgit-46176eca7f130a59813d160415a5ead58133f128.tar.gz
email-gravatar.py: fix UTF-8
-rwxr-xr-xfilters/email-gravatar.py4
1 files changed, 4 insertions, 0 deletions
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 @@
20 20
21import sys 21import sys
22import hashlib 22import hashlib
23import codecs
23 24
24email = sys.argv[1].lower().strip() 25email = sys.argv[1].lower().strip()
25if email[0] == '<': 26if email[0] == '<':
@@ -29,6 +30,9 @@ if email[-1] == '>':
29 30
30page = sys.argv[2] 31page = sys.argv[2]
31 32
33sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach())
34sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
35
32md5 = hashlib.md5(email.encode()).hexdigest() 36md5 = hashlib.md5(email.encode()).hexdigest()
33text = sys.stdin.read().strip() 37text = sys.stdin.read().strip()
34 38