diff --git a/src/main.c b/src/main.c index 30c780d..8d14899 100644 --- a/src/main.c +++ b/src/main.c @@ -506,15 +506,15 @@ const char *get_timezone(const struct tm *local_time) { #ifdef _WIN32 // Windows-specific code + static char namebuf[32*3]; // worst case for UTF-8 TIME_ZONE_INFORMATION tz_info; + wchar_t *name = tz_info.StandardName; if (GetTimeZoneInformation(&tz_info) == TIME_ZONE_ID_DAYLIGHT && local_time->tm_isdst > 0) { - return tz_info.DaylightName; // DST time zone name - } - else - { - return tz_info.StandardName; // Standard time zone name + name = tz_info.DaylightName; } + WideCharToMultiByte(CP_UTF8, 0, name, -1, namebuf, sizeof(namebuf), NULL, NULL); + return namebuf; #else // Unix-like systems (Linux/macOS) code extern char *tzname[2]; // tzname[0] is standard, tzname[1] is DST