Hi,
While testing newlocale(3) function with all locales listed by
How can I install or define LC_COLLATE of these two locales?
FYI, the program I used to test is:
Regards,
While testing newlocale(3) function with all locales listed by
locale -a
on my machine, the function failed with "be_BY.ISO8859-5" and "ca_IT.ISO8859-15" with "No such file or directory":
Code:
$ ls /usr/share/locale/ca_IT.ISO8859-15
LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
$ ls /usr/share/locale/be_BY.ISO8859-5
LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
$ uname -KvU
FreeBSD 14.0-CURRENT #0 main-n254105-d53927b0bae: Thu Mar 31 05:47:31 UTC 2022 [email]root@releng1.nyi.freebsd.org[/email]:/usr/obj/usr/src/riscv.riscv64/sys/GENERIC 1400055 1400055
FYI, the program I used to test is:
Code:
#include <stdlib.h>
#include <stdio.h>
#include <locale.h>
#include <string.h>
int main() {
locale_t loc;
FILE *fp;
char *locname;
char buf[1024];
if ((fp = popen("locale -a", "r")) == NULL)
return 1;
while ((locname = fgets(buf, 1024, fp)) != NULL) {
locname[strlen(locname) - 1] = '\0';
loc = newlocale(LC_COLLATE_MASK, locname, NULL);
if (loc) {
// ok
freelocale(loc);
} else {
printf("%s: NG (%m)\n", locname);
}
}
pclose(fp);
return 0;
}