Index: gdb/gnulib/import/localcharset.c |
diff --git a/gdb/gnulib/import/localcharset.c b/gdb/gnulib/import/localcharset.c |
index b5ee2d6fef67fce20b600f87f885a7af608265ad..8d16c87a76990d997fdeceffe9466ff2023507cc 100644 |
--- a/gdb/gnulib/import/localcharset.c |
+++ b/gdb/gnulib/import/localcharset.c |
@@ -542,5 +542,12 @@ locale_charset (void) |
if (codeset[0] == '\0') |
codeset = "ASCII"; |
+#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) |
+ codeset = "ASCII"; |
+#endif |
+ |
return codeset; |
} |