diff --git a/core/jni/LayoutlibLoader.cpp b/core/jni/LayoutlibLoader.cpp index 77c1a1097240e..4e50f87c086bf 100644 --- a/core/jni/LayoutlibLoader.cpp +++ b/core/jni/LayoutlibLoader.cpp @@ -17,9 +17,9 @@ #include "jni.h" #include "core_jni_helpers.h" -#include -#include #include +#include +#include #include #include @@ -198,6 +198,8 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) { u_setDataDirectory(path); env->ReleaseStringUTFChars(stringPath, path); + // Use English locale for number format to ensure correct parsing of floats when using strtof + setlocale(LC_NUMERIC, "en_US.UTF-8"); return JNI_VERSION_1_6; }