From b385bb4ddcb252e69a1044d702646741e2e489fb Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 15 Feb 2014 12:58:07 -0700 Subject: Emulate POSIX locale setting on Windows Locale initialization and setting on Windows haven't been as described in perllocale for setting locales to "". This is because that tells Windows to use the system default locale, as set through the Control Panel, but on POSIX systems, it means to look at various environment variables. This commit creates a wrapper for setlocale, used only on Windows, that looks for the appropriate environment variables when called with a "" input locale. If none are found, it continues to use the system default locale. --- embed.fnc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'embed.fnc') diff --git a/embed.fnc b/embed.fnc index 6f743e49af..e9795a7cb2 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1069,6 +1069,11 @@ ApdO |AV* |get_av |NN const char *name|I32 flags ApdO |HV* |get_hv |NN const char *name|I32 flags ApdO |CV* |get_cv |NN const char* name|I32 flags Apd |CV* |get_cvn_flags |NN const char* name|STRLEN len|I32 flags +#ifdef WIN32 +ApPM |char* |my_setlocale |int category|NULLOK const char* locale +#else +AmPM |char* |my_setlocale |int category|NULLOK const char* locale +#endif ApOM |int |init_i18nl10n |int printwarn ApOM |int |init_i18nl14n |int printwarn ApOM |void |new_collate |NULLOK const char* newcoll -- cgit v1.2.1