about summary refs log tree commit diff
path: root/Src/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/compat.c')
-rw-r--r--Src/compat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Src/compat.c b/Src/compat.c
index b0bcb6265..09b3d6a5f 100644
--- a/Src/compat.c
+++ b/Src/compat.c
@@ -951,3 +951,18 @@ int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
 /**/
 #endif /* BROKEN_WCWIDTH && (__STDC_ISO_10646__ || __APPLE__) */
 
+/**/
+#if defined(__APPLE__) && defined(BROKEN_ISPRINT)
+
+/**/
+int
+isprint_ascii(int c)
+{
+    if (!strcmp(nl_langinfo(CODESET), "UTF-8"))
+	return (c >= 0x20 && c <= 0x7e);
+    else
+	return isprint(c);
+}
+
+/**/
+#endif /* __APPLE__ && BROKEN_ISPRINT */