blob: 184f57c1468321fa95482bcfac6c85e41f713cdc [file] [log] [blame] [edit]
diff -aruN a/CFLocale.c b/CFLocale.c
--- a/CFLocale.c 2009-02-22 21:56:00.000000000 -0800
+++ b/CFLocale.c 2012-04-20 12:14:07.061605103 -0700
@@ -223,6 +223,19 @@
WindowsLocales = CFArrayCreate(kCFAllocatorSystemDefault, (const void**)s_WindowsInstalledLocales, s_num_installed_localesI, &kCFTypeArrayCallBacks);
return (WindowsLocales);
}
+#elif DEPLOYMENT_TARGET_LINUX
+static CFStringRef __CFLocaleCopyPOSIXLocaleName(void)
+{
+ const char *p = NULL;
+ CFStringRef identifier = NULL;
+
+ p = getenv("LC_ALL");
+
+ if (NULL == p) p = getenv("LANG");
+ if (NULL != p) identifier = CFStringCreateWithCString(kCFAllocatorDefault, p, kCFStringEncodingASCII);
+
+ return (identifier);
+}
#endif // DEPLOYMENT_TARGET_WINDOWS
static Boolean __CFLocaleEqual(CFTypeRef cf1, CFTypeRef cf2) {
@@ -335,6 +348,8 @@
#ifdef DEPLOYMENT_TARGET_WINDOWS
identifier = __CFLocaleWindowsLCIDToISOLocaleName(LOCALE_USER_DEFAULT);
+#elif DEPLOYMENT_TARGET_LINUX
+ identifier = __CFLocaleCopyPOSIXLocaleName();
#endif
struct __CFLocale *locale;