X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flocalcharset.c;h=b80ee895d20dd6d1c36101c693815556dce2a737;hb=1276a2c5f24c0c932426aca9c899fa524d2443f2;hp=1a940423622f3777fc6d40de3d89734e800c591f;hpb=0cd711b27ba11019c96314a42e197bc288f415d7;p=gnulib.git diff --git a/lib/localcharset.c b/lib/localcharset.c index 1a9404236..b80ee895d 100644 --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008-2012 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2014 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,6 +65,11 @@ # include #endif +/* For MB_CUR_MAX_L */ +#if defined DARWIN7 +# include +#endif + #if ENABLE_RELOCATABLE # include "relocatable.h" #else @@ -545,7 +550,7 @@ locale_charset (void) #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