equal
deleted
inserted
replaced
125 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
125 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
126 s.connect((hostname, 43)) |
126 s.connect((hostname, 43)) |
127 """send takes bytes as an input |
127 """send takes bytes as an input |
128 """ |
128 """ |
129 queryBytes = None |
129 queryBytes = None |
|
130 if type(query) is not unicode: |
|
131 query = query.decode('utf-8') |
|
132 |
130 if (hostname == NICClient.DENICHOST): |
133 if (hostname == NICClient.DENICHOST): |
131 # print 'the domain is in NIC DENIC' |
134 # print 'the domain is in NIC DENIC' |
132 queryBytes = ("-T dn,ace -C UTF-8 " + query + "\r\n").encode() |
135 queryBytes = ("-T dn,ace -C UTF-8 " + query + "\r\n").encode('idna') |
133 # print 'queryBytes:', queryBytes |
136 # print 'queryBytes:', queryBytes |
134 else: |
137 else: |
135 queryBytes = (query + "\r\n").encode() |
138 queryBytes = (query + "\r\n").encode('idna') |
136 s.send(queryBytes) |
139 s.send(queryBytes) |
137 """recv returns bytes |
140 """recv returns bytes |
138 """ |
141 """ |
139 # print s |
142 # print s |
140 response = b'' |
143 response = b'' |