Answer the question
In order to leave comments, you need to log in
Java 8 and Java 7. Differences in the operation of the print method of the PrintStream class. What to read on this issue?
It is known that in java 7, as in older versions, in order for System.out.print("Hello") to display Russian text correctly in the Windows console, it was necessary:
1) in the operating system as a program language, not supporting Unicode, set the Russian language;
2) in the console, select the "correct" font and encoding 1251 (chcp 1251).
Today I found that when using java 1.8, the above code is correctly displayed both when the encoding is set to 866 in the console, and even if the language of programs that do not support Unicode is set to a non-Russian language.
Searching the Internet for changes in the implementation of the print method did not yield any results.
It felt like I was the first to discover this phenomenon.
Did I search badly? I would be grateful for links.
Answer the question
In order to leave comments, you need to log in
In java 7, there is no encoding specification for System.out (and System.err), i.e. the default encoding is used (Charset.defaultCharset(), usually taken from the "file.encoding" environment variable): hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/55f6804b4...
Java 8 already has an encoding specification (and specifically for windows it tries to match the console encoding): hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/f7a249818...
Edit: hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/ d38fed7d2ea7
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question