File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/me/grax/jbytemod Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 8
8
import java .awt .event .WindowEvent ;
9
9
import java .io .File ;
10
10
import java .lang .instrument .Instrumentation ;
11
+ import java .lang .reflect .Field ;
12
+ import java .nio .charset .Charset ;
11
13
import java .nio .file .Files ;
12
14
import java .util .HashMap ;
13
15
import java .util .LinkedHashMap ;
@@ -110,6 +112,14 @@ private static void initialize() {
110
112
LOGGER = new Logging ();
111
113
res = new LanguageRes ();
112
114
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
+ }
113
123
}
114
124
115
125
/**
You can’t perform that action at this time.
0 commit comments