summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/locale.c b/locale.c
index a5a2cb3a83..429fdb7b1f 100644
--- a/locale.c
+++ b/locale.c
@@ -345,7 +345,16 @@ Perl_new_ctype(pTHX_ const char *newctype)
/* We only handle single-byte locales (outside of UTF-8 ones; so if
* this locale requires than one byte, there are going to be
* problems. */
- if (check_for_problems && MB_CUR_MAX > 1) {
+ if (check_for_problems && MB_CUR_MAX > 1
+
+ /* Some platforms return MB_CUR_MAX > 1 for even the "C"
+ * locale. Just assume that the implementation for them (plus
+ * for POSIX) is correct and the > 1 value is spurious. (Since
+ * these are specially handled to never be considered UTF-8
+ * locales, as long as this is the only problem, everything
+ * should work fine */
+ && strNE(newctype, "C") && strNE(newctype, "POSIX"))
+ {
multi_byte_locale = TRUE;
}
#endif