zsh-users
 help / color / mirror / code / Atom feed
From: Danek Duvall <duvall@comfychair.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: zsh doesn't understand some multibyte characters
Date: Wed, 13 May 2015 11:29:42 -0700	[thread overview]
Message-ID: <20150513182942.GB4834@lorien.comfychair.org> (raw)
In-Reply-To: <150513104350.ZM28203@torch.brasslantern.com>

On Wed, May 13, 2015 at 10:43:50AM -0700, Bart Schaefer wrote:

> On May 13,  9:14am, Danek Duvall wrote:
> } Subject: zsh doesn't understand some multibyte characters
> }
> } Perhaps this is just on Solaris, I dunno. But for some multibyte
> } characters [...] if I move the cursor back over them or delete back
> } over them, zsh gets confused and moves two positions instead of one
> }
> } I'll note that the same thing happens with all the other shells on
> } Solaris [... ] Where else should I be looking for the problem?
> 
> This sounds like the WCWIDTH() macro or function is returning the wrong
> value for some characters.

It does.

> If you are compiling your own zsh, can you (a) check whether config.h
> defines BROKEN_WCWIDTH, and (b) if it does not, try defining it and
> recompile to see if that makes any difference?

Not on its own; Solaris doesn't appear to define __STDC_ISO_10646__.  But
if I #define that to 1 (because nothing in zsh uses its value), then it
does work.

If I set

    comb_acute_mb[] = { (char)0xe2, (char)0x80, (char)0xa6 };

in the test, it thinks that character's wcwidth() is 2, not 1.  Perhaps
that should be a part of the test as well?  I don't know why the zero-width
combining character was chosen as the test.

I'm less sure what to do about __STDC_ISO_10646__.  I see that most of the
places it's checked you're also checking for __APPLE__, but not all of them
(and I'm not sure why that would be).

I can talk to our globalization folks who might know why this isn't
defined, or what it should be set to, or whatever, and file a bug if
necessary.  I guess until we figure that out, I can just have our zsh build
define it on the commandline (assuming that you don't want to hold 5.0.8
for this, and I wouldn't want you to).

Thanks,
Danek


  reply	other threads:[~2015-05-13 18:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 16:14 Danek Duvall
2015-05-13 17:43 ` Bart Schaefer
2015-05-13 18:29   ` Danek Duvall [this message]
2015-05-13 20:20     ` Bart Schaefer
2015-05-13 21:24       ` Chet Ramey
2015-05-14 16:43     ` Jun T.
2015-05-14 17:32       ` Danek Duvall

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=20150513182942.GB4834@lorien.comfychair.org \
    --to=duvall@comfychair.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).