diff options
author | Christian Hesse | 2014-01-14 11:11:23 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2014-01-14 13:55:35 +0100 |
commit | 46176eca7f130a59813d160415a5ead58133f128 (patch) | |
tree | b428c8d1ebc032a74b5bf3945b094db57e1a370e /filters | |
parent | 50287e7912129881a0157e4ae6dcc42310567c6e (diff) | |
download | cgit-46176eca7f130a59813d160415a5ead58133f128.tar.gz cgit-46176eca7f130a59813d160415a5ead58133f128.tar.bz2 cgit-46176eca7f130a59813d160415a5ead58133f128.zip |
email-gravatar.py: fix UTF-8
Diffstat (limited to 'filters')
-rwxr-xr-x | filters/email-gravatar.py | 4 |
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 | ||
21 | import sys | 21 | import sys |
22 | import hashlib | 22 | import hashlib |
23 | import codecs | ||
23 | 24 | ||
24 | email = sys.argv[1].lower().strip() | 25 | email = sys.argv[1].lower().strip() |
25 | if email[0] == '<': | 26 | if email[0] == '<': |
@@ -29,6 +30,9 @@ if email[-1] == '>': | |||
29 | 30 | ||
30 | page = sys.argv[2] | 31 | page = sys.argv[2] |
31 | 32 | ||
33 | sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach()) | ||
34 | sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) | ||
35 | |||
32 | md5 = hashlib.md5(email.encode()).hexdigest() | 36 | md5 = hashlib.md5(email.encode()).hexdigest() |
33 | text = sys.stdin.read().strip() | 37 | text = sys.stdin.read().strip() |
34 | 38 | ||