File tree Expand file tree Collapse file tree
src/main/java/me/grax/jbytemod Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import java .awt .event .WindowEvent ;
99import java .io .File ;
1010import java .lang .instrument .Instrumentation ;
11+ import java .lang .reflect .Field ;
12+ import java .nio .charset .Charset ;
1113import java .nio .file .Files ;
1214import java .util .HashMap ;
1315import java .util .LinkedHashMap ;
@@ -110,6 +112,14 @@ private static void initialize() {
110112 LOGGER = new Logging ();
111113 res = new LanguageRes ();
112114 ops = new Options ();
115+ try {
116+ System .setProperty ("file.encoding" ,"UTF-8" );
117+ Field charset = Charset .class .getDeclaredField ("defaultCharset" );
118+ charset .setAccessible (true );
119+ charset .set (null ,null );
120+ } catch (Throwable t ) {
121+ JByteMod .LOGGER .err ("Failed to set encoding to UTF-8 (" + t .getMessage () + ")" );
122+ }
113123 }
114124
115125 /**
You can’t perform that action at this time.
0 commit comments