Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Unicode additions, next phase.
- X-seq: zsh-workers 20751
- From: Clint Adams <clint@xxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: PATCH: Unicode additions, next phase.
- Date: Wed, 26 Jan 2005 09:26:45 -0500
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <200501261033.j0QAXmjA032042@xxxxxxxxxxxxxx>
- Mail-followup-to: Peter Stephenson <pws@xxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200501251446.j0PEkoFJ024136@xxxxxxxxxxxxxx> <20050126022947.GA12574@xxxxxxxxxxx> <200501261033.j0QAXmjA032042@xxxxxxxxxxxxxx>
> Plus we'll probably need to have wcwidth on the menu at some
Oh dear.. also any memory allocations based on winw have to be modified.
> point... not sure if that helps with wide characters that are control
> characters (do these exist?), probably not. I'd be tempted to see if
> control characters were converted to a single byte string, if they do
> print them as at present, and if they don't just skip them; same for
> conversion failures, although that shouldn't happen for characters that
> convert to 7-bit ASCII anyway.
This uses '?' for both eventualities. That might obscure character
conversion errors.
Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.15
diff -u -r1.15 zle_refresh.c
--- Src/Zle/zle_refresh.c 26 Jan 2005 13:39:52 -0000 1.15
+++ Src/Zle/zle_refresh.c 26 Jan 2005 14:24:23 -0000
@@ -478,7 +478,7 @@
nextline
}
#ifdef ZLE_UNICODE_SUPPORT
-# error What to do here
+ *s++ = ((*t == 127) || (*t > 255)) ? '?' : (*t | '@');
#else
*s++ = (*t == 127) ? '?' : (*t | '@');
#endif
@@ -488,7 +488,7 @@
i = wcrtomb(s, *t, &shiftstate);
if (i == -1) {
- /* error; what to do? */
+ *s++ = '?';
} else {
s += i;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author