From f40bf4ca2a0452ebadc8f14f2f8386cfc29952dc Mon Sep 17 00:00:00 2001 From: Peter Zaoral Date: Tue, 12 Mar 2024 22:27:12 +0100 Subject: [PATCH] Set the default locale for the JVM to English to prevent locale-specific character variations * introduced the JAVA_LOCALE variable within kc.sh|bat in order to control JVM locale Closes #26438 Signed-off-by: Peter Zaoral --- quarkus/dist/src/main/content/bin/kc.bat | 8 ++++++++ quarkus/dist/src/main/content/bin/kc.sh | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/quarkus/dist/src/main/content/bin/kc.bat b/quarkus/dist/src/main/content/bin/kc.bat index 2f49895557..16e6d8b435 100644 --- a/quarkus/dist/src/main/content/bin/kc.bat +++ b/quarkus/dist/src/main/content/bin/kc.bat @@ -105,6 +105,14 @@ if not "x%JAVA_ADD_OPENS%" == "x" ( ) set "JAVA_OPTS=%JAVA_OPTS% %JAVA_ADD_OPENS%" +@REM Set the default locale for the JVM to English to prevent locale-specific character variations +if not "x%JAVA_LOCALE%" == "x" ( + echo "JAVA_LOCALE already set in environment; overriding default settings with values: %JAVA_LOCALE%" +) else ( + set "JAVA_LOCALE=-Duser.language=en -Duser.country=US" +) +set "JAVA_OPTS=%JAVA_OPTS% %JAVA_LOCALE%" + if not "x%JAVA_OPTS_APPEND%" == "x" ( echo "Appending additional Java properties to JAVA_OPTS: %JAVA_OPTS_APPEND%" set JAVA_OPTS=%JAVA_OPTS% %JAVA_OPTS_APPEND% diff --git a/quarkus/dist/src/main/content/bin/kc.sh b/quarkus/dist/src/main/content/bin/kc.sh index d79871f374..7e40aade59 100644 --- a/quarkus/dist/src/main/content/bin/kc.sh +++ b/quarkus/dist/src/main/content/bin/kc.sh @@ -126,6 +126,14 @@ else fi JAVA_OPTS="$JAVA_OPTS $JAVA_ADD_OPENS" +# Set the default locale for the JVM to English to prevent locale-specific character variations +if [ -z "$JAVA_LOCALE" ]; then + JAVA_LOCALE="-Duser.language=en -Duser.country=US" +else + echo "JAVA_LOCALE already set in environment; overriding default settings with values: $JAVA_LOCALE" +fi +JAVA_OPTS="$JAVA_OPTS $JAVA_LOCALE" + if [ -n "$JAVA_OPTS_APPEND" ]; then echo "Appending additional Java properties to JAVA_OPTS: $JAVA_OPTS_APPEND" JAVA_OPTS="$JAVA_OPTS $JAVA_OPTS_APPEND"