mirror of
https://git.zx2c4.com/cgit
synced 2025-08-19 00:40:18 +02:00
email-gravatar.py: fix UTF-8
This commit is contained in:
parent
50287e7912
commit
46176eca7f
1 changed files with 4 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import codecs
|
||||||
|
|
||||||
email = sys.argv[1].lower().strip()
|
email = sys.argv[1].lower().strip()
|
||||||
if email[0] == '<':
|
if email[0] == '<':
|
||||||
|
@ -29,6 +30,9 @@ if email[-1] == '>':
|
||||||
|
|
||||||
page = sys.argv[2]
|
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()
|
md5 = hashlib.md5(email.encode()).hexdigest()
|
||||||
text = sys.stdin.read().strip()
|
text = sys.stdin.read().strip()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue