Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.zx2c4.com/cgit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 @@
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()