Hi OpenBSD folks,

I tried building the fmt library on OpenBSD 7.4 on x86_64 and a few of its unit tests fail. First we thought it was maybe a libc++ bug, but in fact it seems to be an OpenBSD bug:

Reduced case:

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

int main() {
  setlocale(LC_TIME, "es_ES.UTF-8");
  wchar_t str[100];
  time_t t = time(NULL);
  wcsftime(str, 100, L"%a", localtime(&t));
  wprintf(L"%ls\n", str);
}
```

When run on a Tuesday, it gives "Tue". It should be outputting "mar", for Spanish "martes" (meaning Tuesday). That's what I get with macOS and FreeBSD.

Giving the output in the wrong language looks like a bug.

See also:

https://github.com/fmtlib/fmt/issues/3670
https://github.com/llvm/llvm-project/issues/71871

Thanks,

Sean

Reply via email to