为什么localeconv()在Linux上的意大利语(it_IT)中为thousands_sep返回空字符串(“”)?它在Mac OS X上运行良好。
#include <stdio.h>
#include <locale.h>
int main () {
struct lconv * lc;
printf("locale %s\n", setlocale(LC_NUMERIC, "it_IT"));
lc = localeconv();
printf("Thousands Sep: %s\n",lc->thousands_sep);
printf("Decimal Point = %s\n", lc->decimal_point);
printf("locale %s\n", setlocale(LC_NUMERIC, "en_US"));
lc = localeconv();
printf("Thousands Sep: %s\n",lc->thousands_sep);
printf("Decimal Point = %s\n", lc->decimal_point);
return 0;
}
Mac OS X 10.9.1:
locale it_IT
Thousands Sep: .
Decimal Point = ,
locale en_US
Thousands Sep: ,
Decimal Point = .
Ubuntu 12.10:
locale it_IT
Thousands Sep:
Decimal Point = ,
locale en_US
Thousands Sep: ,
Decimal Point = .
CentOS 6.5:
locale it_IT
Thousands Sep:
Decimal Point = ,
locale en_US
Thousands Sep: ,
Decimal Point = .