summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
Diffstat (limited to 'pith')
-rw-r--r--pith/charconv/utf8.c10
-rw-r--r--pith/pine.hlp7
2 files changed, 16 insertions, 1 deletions
diff --git a/pith/charconv/utf8.c b/pith/charconv/utf8.c
index 1651252e..42a364b3 100644
--- a/pith/charconv/utf8.c
+++ b/pith/charconv/utf8.c
@@ -125,6 +125,7 @@ pith_ucs4width(UCS ucs)
int
wtomb(char *dest, UCS ucs)
{
+ int rv;
/*
* We believe that on modern unix systems wchar_t is a UCS-4 character.
* That's the assumption here.
@@ -150,7 +151,14 @@ wtomb(char *dest, UCS ucs)
return(ret);
}
else
- return(wcrtomb(dest, (wchar_t) ucs, NULL));
+#if defined(HAVE_WCRTOMB)
+ rv = wcrtomb(dest, (wchar_t) ucs, NULL);
+#elif defined(HAVE_WCTOMB)
+ rv = wctomb(dest, (wchar_t) ucs);
+#else
+ rv = -1;
+#endif
+ return rv;
}
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 2605ae02..a226e997 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -35312,7 +35312,14 @@ To convert from Unicode to multi-byte the routine
<CENTER><SAMP>wcrtomb</SAMP></CENTER>
<P>
+is used, if available, otherwise
+
+<P>
+<CENTER><SAMP>wctomb</SAMP></CENTER>
+<P>
+
is used.
+
And to find the screen width a particular Unicode character will
occupy the routine used is