text/plain인터넷을 통해 한 줄씩 파일 을 읽으려고합니다 . 지금 가지고있는 코드는 다음과 같습니다.
URL url = new URL("http://kuehldesign.net/test.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
LinkedList<String> lines = new LinkedList();
String readLine;
while ((readLine = in.readLine()) != null) {
lines.add(readLine);
}
for (String line : lines) {
out.println("> " + line);
}
파일 test.txt에는 ¡Hélló!인코딩을 테스트하기 위해 사용하고있는이 포함되어 있습니다 .
OutputStream( out)를 검토하면 > ¬°H√©ll√≥!. 나는 문제 없이 OutputStream할 수 있기 때문에 이것이 문제라고 생각하지 않습니다 out.println("é");.
읽기에 대한 아이디어가 InputStreamUTF-8로 형성 됩니까? 감사!