diff -r 8c4c05eb65f4 -r f9da616f15cf whois/whois.py --- a/whois/whois.py Fri Aug 15 11:59:58 2014 +0300 +++ b/whois/whois.py Fri Aug 15 13:31:24 2014 +0300 @@ -127,12 +127,15 @@ """send takes bytes as an input """ queryBytes = None + if type(query) is not unicode: + query = query.decode('utf-8') + if (hostname == NICClient.DENICHOST): # print 'the domain is in NIC DENIC' - queryBytes = ("-T dn,ace -C UTF-8 " + query + "\r\n").encode() + queryBytes = ("-T dn,ace -C UTF-8 " + query + "\r\n").encode('idna') # print 'queryBytes:', queryBytes else: - queryBytes = (query + "\r\n").encode() + queryBytes = (query + "\r\n").encode('idna') s.send(queryBytes) """recv returns bytes """