zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: assume "enhanced goodness" when --multibyte-enable
Date: Thu, 15 Dec 2005 12:09:07 +0000	[thread overview]
Message-ID: <EXCHANGE03HBYSxclUu000024d3@exchange03.csr.com> (raw)
In-Reply-To: <20051215115203.38783.qmail@web25223.mail.ukl.yahoo.com>

Oliver Kiddle wrote:
> Peter wrote:
> > 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.
> 
> This doesn't make sense to me. With MULTIBYTE_SUPPORT enabled are you
> just assuming that wchar_t is UCS-4 everywhere?

ish...

> I don't understand how that'll work if you have a system which has
> perfectly good multibyte support but uses some other encoding for
> wchar_t.

It might well not, but up to now I've been assuming we need to know how
to convert it.  --enable-multibyte just says "go ahead and assume this
works".  Unless we can probe for what to do with a wchar_t I've been
assuming we're kind of stuck.

However, the assumptions we rely on are a bit different in the code for
converting Unicode characters and in the reset of zle, so quite likely
they shouldn't be tied...

In converting \U/\u sequences, as you say, we really need fully paid up
UCS-4.

In the reset of zle, we need wchar_t to be an integer which overlaps
with ASCII in positions 0 to 127, and we only need that in some places.
(A lot of the time we can work on the pre-converted multibyte string,
since that *must* have ASCII has a subset, and it's probably possible to
do that everywhere by additional conversions.)  I don't think it
necessarily has to be exactly UCS-4 and most of the time it probably
works if it isn't.  So maybe the change is wrong.

-- 
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


  reply	other threads:[~2005-12-15 12:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15 11:52 Oliver Kiddle
2005-12-15 12:09 ` Peter Stephenson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-12-14 18:22 Peter Stephenson
2005-12-14 19:06 ` Wayne Davison

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=EXCHANGE03HBYSxclUu000024d3@exchange03.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).