December 30, 2015

UTF-8 Charset as Constant in Java 7

Since Java 7 UTF-8 as a constant has been introduced with java.nio.charset.StandardCharsets

Example

new LineNumberReader(new InputStreamReader(new FileInputStream("foo.ini"), StandardCharsets.UTF_8));

No comments: