Add reverse conversion from string to LCID

This commit is contained in:
Laci bá
2021-11-13 23:51:29 +01:00
parent bf3767bc4a
commit dfa795b267
2 changed files with 17 additions and 0 deletions

View File

@@ -1221,6 +1221,22 @@ plat_language_code(char* langcode)
return lcid;
}
/* Converts back the language code to LCID */
void
plat_language_code_r(uint32_t lcid, char* outbuf, int len)
{
if (lcid == 0xFFFF)
{
strcpy(outbuf, "system");
return;
}
wchar_t buffer[LOCALE_NAME_MAX_LENGTH + 1];
LCIDToLocaleName(lcid, buffer, LOCALE_NAME_MAX_LENGTH, 0);
c16stombs(outbuf, buffer, len);
}
void
take_screenshot(void)
{