...
java -Dfile.encoding=UTF-8 … ... com.x.Main
The available encodings are listed in the Supported Encodings document [Encodings 2014]. In the absence of an explicitly specified encoding, conversions use the system default encoding. Compatible encodings must be used when characters are output as an array of bytes then input by another JVM and subsequently converted back to characters.
...
Sound automated detection of this vulnerability is not feasible.
Bibliography
...