Skip to content

Instantly share code, notes, and snippets.

@BioQwer
Created August 25, 2015 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BioQwer/e8cb90ab7faa3b6f7562 to your computer and use it in GitHub Desktop.
Save BioQwer/e8cb90ab7faa3b6f7562 to your computer and use it in GitHub Desktop.
Provide UTF-8 encoding without -D on start JVM
try {
System.setProperty("file.encoding", "UTF-8");
Field charset = Charset.class.getDeclaredField("defaultCharset");
charset.setAccessible(true);
charset.set(null, null);
} catch (IllegalAccessException | NoSuchFieldException e) {
e.getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment