From ef3572ea73ea23df2d55033043d9d46b4609e157 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 19 Mar 2026 16:09:57 +0100 Subject: [PATCH] Make smartctl to ignore locale --- cmdline/mingw.c | 3 +++ cmdline/unix.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cmdline/mingw.c b/cmdline/mingw.c index 64e35ec5..747cae9f 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -177,6 +177,9 @@ void os_init(int opt) } exedir_init(); + + /* set LC_ALL=C to make smartctl ignoring the locale when printing info */ + _wputenv_s(L"LC_ALL", L"C"); } void os_done(void) diff --git a/cmdline/unix.c b/cmdline/unix.c index 7343da0e..8cfc2601 100644 --- a/cmdline/unix.c +++ b/cmdline/unix.c @@ -2404,6 +2404,9 @@ void os_init(int opt) } #endif + /* set LC_ALL=C to make smartctl ignoring the locale when printing info */ + setenv("LC_ALL", "C", 1); + (void)opt; }