Skip to content

Commit 899b79c

Browse files
committed
Remove UTF-8 check as it's the default in Java 21
1 parent b852ecb commit 899b79c

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/main/java/me/replydev/qubo/CLI.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public class CLI {
3737
*/
3838
void init(String[] args) {
3939
printLogo();
40-
checkEncodingParameter();
4140
standardRun(args);
4241

4342
log.info("Scan terminated - {} ({}) in total",
@@ -68,24 +67,4 @@ private void standardRun(String[] args) {
6867
new CommandLineArgs(args).showHelpAndExit();
6968
}
7069
}
71-
72-
/**
73-
* Checks if the JVM is running in UTF-8 encoding mode and exits if not.
74-
*/
75-
private void checkEncodingParameter() {
76-
if (!isUTF8Mode()) {
77-
log.error("The scanner isn't running in UTF-8 mode!");
78-
log.error("Put \"-Dfile.encoding=UTF-8\" in JVM args in order to run the program correctly!");
79-
System.exit(-1);
80-
}
81-
}
82-
83-
/**
84-
* Checks if UTF-8 mode is enabled for file encoding.
85-
* @return true if UTF-8 mode is set, false otherwise.
86-
*/
87-
private boolean isUTF8Mode() {
88-
List<String> arguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
89-
return arguments.stream().anyMatch(arg -> arg.equals("-Dfile.encoding=UTF-8"));
90-
}
9170
}

0 commit comments

Comments
 (0)