+2012-12-20 Daiki Ueno <ueno@gnu.org>
+
+ localecharset: respect the thread-specific locale on Mac OS X
+ * lib/localcharset.c (locale_charset) [DARWIN7]: Use MB_CUR_MAX_L
+ instead of MB_CUR_MAX.
+
2012-12-21 Daiki Ueno <ueno@gnu.org>
Fix W64 build errors.
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2006, 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2000-2006, 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
# include <os2.h>
#endif
+/* For MB_CUR_MAX_L */
+#if defined DARWIN7
+# include <xlocale.h>
+#endif
+
#if ENABLE_RELOCATABLE
# include "relocatable.h"
#else
#ifdef DARWIN7
/* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
(the default codeset) does not work when MB_CUR_MAX is 1. */
- if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX <= 1)
+ if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
codeset = "ASCII";
#endif