I wrote:

> Martin Storsjö <[email protected]> wrote:
>
>> Also, for what it's worth - as far as I know, most of the locale functions
>> in msvcrt.dll are mostly not really working anyway, in any version of
>> Windows.
>
> Hm, that's interesting; let me check it.

I tried the following program:

```
#define __USE_MINGW_ANSI_STDIO 0

#include <locale.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>

int main (int argc, char **argv) {
  _locale_t locale = _create_locale (LC_ALL, argc > 1 ? argv[1] : "");
  if (locale == NULL) {
    fwprintf (stderr, L"Failed to create locale\n");
    return 1;
  }
  time_t t = time (NULL);
  struct tm *tm = localtime (&t);
  wchar_t buf[BUFSIZ];
  // no _strftime_l in msvcrt.dll
  _wcsftime_l (buf, BUFSIZ, L"%c", tm, locale);
  wprintf (L"%s\n", buf);
  return 0;
}
```

You can pass different locales (simple strings such as "English", "German", 
"Korean" etc. will suffice), and you will see that written time string differs 
from one locale to another, although not much.

It is possible that on pre-Windows 8 they were really simply equivalent regular 
versions.

- Kirill Makurin

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to