From 1d120035557c04002fbb5660e43e6175dbfa3871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 12 Aug 2026 10:19:22 +0800 Subject: [PATCH] Locale (Windows): uses $LANG if available e.g. MSYS2 --- src/detection/locale/locale_windows.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/detection/locale/locale_windows.c b/src/detection/locale/locale_windows.c index 0f17e8bfa..4f5896667 100644 --- a/src/detection/locale/locale_windows.c +++ b/src/detection/locale/locale_windows.c @@ -1,9 +1,19 @@ #include "detection/locale/locale.h" #include "common/windows/unicode.h" -#include +#include const char* ffDetectLocale(FFstrbuf* result) { + ffStrbufAppendS(result, getenv("LC_ALL")); + if (result->length > 0) { + return nullptr; + } + + ffStrbufAppendS(result, getenv("LANG")); // Available in MSYS2 and Cygwin + if (result->length > 0) { + return nullptr; + } + wchar_t name[LOCALE_NAME_MAX_LENGTH]; int size = GetUserDefaultLocaleName(name, LOCALE_NAME_MAX_LENGTH); if (size <= 1) { // including '\0'