Whois: allow UTF8

pull/210/head
M66B 3 years ago
parent bf348302bc
commit 45ea1f95d1

@ -45,9 +45,9 @@ public class Whois {
Socket socket = new Socket(); Socket socket = new Socket();
socket.connect(new InetSocketAddress(host, port), WHOIS_TIMEOUT); socket.connect(new InetSocketAddress(host, port), WHOIS_TIMEOUT);
try { try {
byte[] request = (domain + "\r\n").getBytes(StandardCharsets.ISO_8859_1); byte[] request = (domain + "\r\n").getBytes(StandardCharsets.UTF_8);
socket.getOutputStream().write(request); socket.getOutputStream().write(request);
String response = Helper.readStream(socket.getInputStream(), StandardCharsets.ISO_8859_1); String response = Helper.readStream(socket.getInputStream(), StandardCharsets.UTF_8);
return host + ":" + port + "\n\n" + response; return host + ":" + port + "\n\n" + response;
} finally { } finally {
socket.close(); socket.close();

Loading…
Cancel
Save