# HG changeset patch # User Richard Penman # Date 1458137295 -3600 # Node ID fa9650e9ec23061db70a8f50cd127cb931b7af96 # Parent 50b5966b55663b3a95e157680dc033b321360eac removed to ascii function and treat as utf-8 diff -r 50b5966b5566 -r fa9650e9ec23 setup.py --- a/setup.py Mon Sep 14 15:19:11 2015 +0100 +++ b/setup.py Wed Mar 16 15:08:15 2016 +0100 @@ -1,7 +1,7 @@ import sys, os import setuptools -version = '0.5.1' +version = '0.5.2' setuptools.setup( name='python-whois', diff -r 50b5966b5566 -r fa9650e9ec23 whois/whois.py --- 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"""