merged
authorRichard Penman
Wed, 16 Mar 2016 15:18:36 +0100
changeset 81 359baebcf0e8
parent 80 fa9650e9ec23 (diff)
parent 79 95f170b4fd13 (current diff)
child 82 fc40924ac59b
merged
setup.py
whois/whois.py
--- a/setup.py	Wed Mar 02 10:36:21 2016 +0000
+++ b/setup.py	Wed Mar 16 15:18:36 2016 +0100
@@ -1,7 +1,7 @@
 import sys, os
 import setuptools
 
-version = '0.6'
+version = '0.6.1'
 
 setuptools.setup(
     name='python-whois',
--- a/whois/whois.py	Wed Mar 02 10:36:21 2016 +0000
+++ b/whois/whois.py	Wed Mar 16 15:18:36 2016 +0100
@@ -38,9 +38,6 @@
 import optparse
 
 
-def enforce_ascii(a):
-    return a if isinstance(a, bytes) else bytes([63 if ord(c) > 127 else ord(c) for c in a]).decode('ascii')
-
 class NICClient(object):
 
     ABUSEHOST = "whois.abuse.net"
@@ -123,14 +120,15 @@
             return ''
         else:
             nhost = None
-            response = enforce_ascii(response)
+            response = response.decode('utf-8')
             if b'with "=xxx"' in response:
                 return self.whois(query, hostname, flags, True)
             if flags & NICClient.WHOIS_RECURSE and nhost is None:
-                nhost = self.findwhois_server(response.decode(), hostname, query)
+                nhost = self.findwhois_server(response, hostname, query)
             if nhost is not None:
-                response += self.whois(query, nhost, 0).encode('utf-8')
-            return response.decode()
+                response += self.whois(query, nhost, 0)
+            return response
+
 
     def choose_server(self, domain):
         """Choose initial lookup NIC host"""