Read a file character by character/UTF8: Difference between revisions
Read a file character by character/UTF8 (view source)
Revision as of 15:16, 9 April 2023
, 1 year ago→{{header|Java}}
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
|||
Line 370:
=={{header|Java}}==
<syntaxhighlight lang="java">
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
Line 377 ⟶ 379:
public static void main(String[] args) throws IOException {
final int endOfFile = -1;
var reader = new FileReader("input.txt", StandardCharsets.UTF_8);▼
while (true) {▼
int c = reader.read();▼
System.out.print(Character.toChars(c));▼
if ( ch ==
break;
}
}
}
}
}
=={{header|jq}}==
|