X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/786609bd36c07b85dbf905fc8c36eba7132122d7..dbaee2672be14374acb17266477c19294c6155f3:/filters/email-gravatar.py diff --git a/filters/email-gravatar.py b/filters/email-gravatar.py index f90b87d..d70440e 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,7 +30,10 @@ 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() -print(" " + text) +print("Gravatar " + text)