whois/whois.py
changeset 80 fa9650e9ec23
parent 65 50b5966b5566
child 81 359baebcf0e8
--- a/whois/whois.py	Mon Sep 14 15:19:11 2015 +0100
+++ b/whois/whois.py	Wed Mar 16 15:08:15 2016 +0100
@@ -30,18 +30,6 @@
 import optparse
 
 
-def enforce_ascii(a):
-    if isinstance(a, str) or isinstance(a, unicode):
-        r = ""
-        for i in a:
-            if ord(i) >= 128:
-                r += "?"
-            else:
-                r += i
-        return r
-    else:
-        return a
-
 
 class NICClient(object):
 
@@ -125,14 +113,14 @@
             return ''
         else:
             nhost = None
-            response = enforce_ascii(response)
+            response = response.decode('utf-8')
             if '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)
-            return response.decode()
+            return response
 
     def choose_server(self, domain):
         """Choose initial lookup NIC host"""