Reputation: 10697
Many ICU functions take a char * representing the locale as a parameter. If I statically set this to "ko_KR", for example, then it does indeed operate in a locale-sensitive manner.
However, I want to determine the current locale based on system settings for time formatting. As far as I understand, most systems have a locale setting for displaying numbers, time, money, etc and these could all vary. Any ideas about how to do this would be greatly appreciated!
Upvotes: 0
Views: 1142
Reputation: 4350
uloc_getDefault() will return the overall default locale that ICU detected from the underlying system. The categories you mentioned don't cleanly map across all operating systems.
Upvotes: 2
Reputation: 10697
Seems this can be done with the locale.h functions
char * loc;
loc = setlocale(LC_TIME, "");
Upvotes: 1