From edc1c4c1eb5de9a8d8e0aa9cf5cd913cc892c254 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 20 Dec 2024 23:42:59 +0100 Subject: [PATCH] Add charset check --- .../src/main/kotlin/de/staropensource/engine/base/Engine.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt b/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt index 00fa421e4..ac5227b83 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt @@ -25,6 +25,8 @@ import de.staropensource.engine.base.logging.Logger import de.staropensource.engine.base.utility.Environment import de.staropensource.engine.base.utility.FileAccess import de.staropensource.engine.base.utility.dnihbd.BuildInformation +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets /** * Primary class of the engine. @@ -159,7 +161,9 @@ class Engine private constructor() { logger.info("Bootstrapping") // Run bootstrapping code - // *none yet* + // -> Run checks + if (Charset.defaultCharset() != StandardCharsets.UTF_8) + logger.crash("The StarOpenSource Engine does not support other charsets than UTF-8") // Bootstrap subsystems logger.verb("Bootstrapping subsystems")