Answer the question
In order to leave comments, you need to log in
Why, when receiving the URL of the page through the InputStream, instead of Russian characters, krakazables are obtained?
I'm trying to get HTML, but instead of Russian characters I get some kind of bugs. Help solve the problem.
public class ParsingDownload {
public static void PageDownload() throws MalformedURLException {
URL url = new URL(" yandex.ru ");
try {
InputStream page = url.openStream();
while (true) {
int oneByte = page.read();
if (oneByte != -1) {
System.out.printf(String.valueOf((char) oneByte));
} else {
break;
}
}
} catch (Exception e) {
System. out. println("lol");
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question