From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: assume "enhanced goodness" when --multibyte-enable
Date: Wed, 14 Dec 2005 18:22:25 +0000 [thread overview]
Message-ID: <200512141822.jBEIMPjF027531@news01.csr.com> (raw)
In utils.c we don't enable the full multibyte code for converting
characters unless __STDC_ISO_10646__ is turned on. However, everywhere
in zle we simply trust that if --multibyte-enable is turned on
everything just works. That includes wctomb(), which is all we need
for character conversion.
Hence I think we need to make the same assumption in utils.c, too. This
makes things (in particular insert-{composed,unicode}-char) work better
on Solaris 8.
Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.105
diff -u -r1.105 utils.c
--- Src/utils.c 30 Nov 2005 16:35:33 -0000 1.105
+++ Src/utils.c 14 Dec 2005 18:17:29 -0000
@@ -3918,7 +3918,7 @@
}
#endif
-# if defined(HAVE_NL_LANGINFO) && defined(CODESET) && !defined(__STDC_ISO_10646__)
+# if defined(HAVE_NL_LANGINFO) && defined(CODESET) && !defined(__STDC_ISO_10646__) && !defined(MULTIBYTE_SUPPORT)
/* Convert a character from UCS4 encoding to UTF-8 */
/**/
@@ -3984,7 +3984,7 @@
char svchar = '\0';
int meta = 0, control = 0;
int i;
-#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && defined(__STDC_ISO_10646__)
+#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && (defined(__STDC_ISO_10646__) || defined(MULTIBYTE_SUPPORT))
wint_t wval;
size_t count;
#else
@@ -4093,7 +4093,7 @@
*misc = wval;
return s+1;
}
-#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && defined(__STDC_ISO_10646__)
+#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && (defined(__STDC_ISO_10646__) || defined(MULTIBYTE_SUPPORT))
count = wctomb(t, (wchar_t)wval);
if (count == (size_t)-1) {
zerr("character not in range", NULL, 0);
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
next reply other threads:[~2005-12-14 18:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-14 18:22 Peter Stephenson [this message]
2005-12-14 19:06 ` Wayne Davison
2005-12-15 11:52 Oliver Kiddle
2005-12-15 12:09 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200512141822.jBEIMPjF027531@news01.csr.com \
--to=pws@csr.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).