What does -Dfile.encoding = UTF-8 in JAVA_OPTIONS do
1 answer
It sets a property that determines in which encoding to save and read files by default. It must be installed when the JVM starts.
There are several encodings - the ways in which characters are represented on computers. UTF-8 is one of the best to use as it contains all the special characters in many languages.
Once you don't have this property, Java can save files in a different encoding, which can lead to strange characters when you open the file with a text editor. You can avoid this problem by manually setting the desired encoding on OutputStream
s.
+2
source to share