]> gitweb.ps.run Git - ps-cgit/blobdiff - filters/email-gravatar.py
email-gravatar.py: fix UTF-8
[ps-cgit] / filters / email-gravatar.py
index 44456155fedd7801d5ae85bb1ae282350fcd4e31..5d08ea8693be62330e6ff0ffc4fb6dd482a3a6a1 100755 (executable)
@@ -20,6 +20,7 @@
 
 import sys
 import hashlib
+import codecs
 
 email = sys.argv[1].lower().strip()
 if email[0] == '<':
@@ -27,6 +28,11 @@ if email[0] == '<':
 if email[-1] == '>':
         email = email[0:-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()