mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 10:52:08 +02:00
Locale (Windows): print standard format
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include "detection/locale/locale.h"
|
||||
#include "util/windows/unicode.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <locale.h>
|
||||
|
||||
void ffDetectLocale(FFstrbuf* result)
|
||||
{
|
||||
wchar_t name[LOCALE_NAME_MAX_LENGTH];
|
||||
int size = GetUserDefaultLocaleName(name, LOCALE_NAME_MAX_LENGTH);
|
||||
if (size > 1) // including '\0'
|
||||
{
|
||||
ffStrbufSetNWS(result, (uint32_t)size - 1, name);
|
||||
ffStrbufAppendS(result, ".UTF-8"); // set explictly in `ffInitInstance`
|
||||
}
|
||||
else
|
||||
ffStrbufSetS(result, setlocale(LC_ALL, NULL));
|
||||
}
|
||||
Reference in New Issue
Block a user