Skip to content

Commit 34856f8

Browse files
authored
Merge pull request #4 from humblepoti/patch-1
Update net.py
2 parents 135d11c + 93672ea commit 34856f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pythonwhois/net.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,9 @@ def whois_request(domain, server, port=43, timeout=None):
9292
if len(data) == 0:
9393
break
9494
buff += data
95-
return buff.decode("utf-8")
95+
try:
96+
d = buff.decode("utf-8")
97+
except UnicodeDecodeError:
98+
d = buff.decode("latin-1")
99+
100+
return d

0 commit comments

Comments
 (0)