zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: zsh-workers@zsh.org, Peter Stephenson <p.stephenson@samsung.com>
Subject: Re: Cannot paste unicode <0221>, <0234> - <024f>
Date: Fri, 28 Apr 2017 17:27:16 +0200	[thread overview]
Message-ID: <etPan.59035f54.109cf92e.15fbc@MacMini.local> (raw)
In-Reply-To: <20170428154135.2e2b5626@pwslap01u.europe.root.pri>

On 28 kwietnia 2017 at 16:42:17, Peter Stephenson (p.stephenson@samsung.com) wrote:
> It might be possible to rely *only* on wcwidth() in cases where we're
> using a replacement? Does anyone from the Apple world have any
> opinions?
>  
> pws
>  
> diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c

I've checked the patch, no luck, but I knew what to track, so I've added:

    fprintf( stderr, "Path 1, char/string: %S\n", t );
and
    fprintf( stderr, "Path 3, char/string: %S, iswprint:%d, wcwidth: %d\n", t, iswprint(*t), WCWIDTH(*t));

for printable / unprintable if-paths, and the result is:

Path 1, char/string: ȯȰȱȲȳȴȵȶȷȸȹ
Path 1, char/string: ȰȱȲȳȴȵȶȷȸȹ
Path 1, char/string: ȱȲȳȴȵȶȷȸȹ
Path 1, char/string: Ȳȳȴȵȶȷȸȹ
Path 1, char/string: ȳȴȵȶȷȸȹ
Path 3, char/string: ȴȵȶȷȸȹ, iswprint:0, wcwidth: -1
Path 3, char/string: ȵȶȷȸȹ, iswprint:0, wcwidth: -1
Path 3, char/string: ȶȷȸȹ, iswprint:0, wcwidth: -1
Path 3, char/string: ȷȸȹ, iswprint:0, wcwidth: -1
Path 3, char/string: ȸȹ, iswprint:0, wcwidth: -1
Path 3, char/string: ȹ, iswprint:0, wcwidth: -1

What's interesting, once or twice the print looked like following (recompile fixed this):

Path 1, char/string: ȯȰȱȲȳȴȵȶȷȸȹiⱁ
                                  ÍA䰂Ӄ࢑࠱䙁怲དྷĝ²ũǝ
Path 1, char/string: ȰȱȲȳȴȵȶȷȸȹiⱁ
                                 ÍA䰂Ӄ࢑࠱䙁怲དྷĝ²ũǝ
Path 1, char/string: ȱȲȳȴȵȶȷȸȹiⱁ
                                ÍA䰂Ӄ࢑࠱䙁怲དྷĝ²ũǝ
...

like if printf() wasn't sure itself should %S print those characters correctly or not. That said, vim or mentioned bash somehow manage this, just as a reference point if stdlib is broken or not(-really).

-- 
Sebastian Gniazdowski



  reply	other threads:[~2017-04-28 15:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170428111102epcas3p1cc3d86dc54fdafd8cd0e613bbaeba69b@epcas3p1.samsung.com>
2017-04-28 10:55 ` Sebastian Gniazdowski
2017-04-28 11:44   ` Peter Stephenson
2017-04-28 12:11     ` Sebastian Gniazdowski
2017-04-28 13:16       ` Peter Stephenson
2017-04-28 13:54         ` Sebastian Gniazdowski
2017-04-28 14:10           ` Peter Stephenson
2017-04-28 14:41           ` Peter Stephenson
2017-04-28 15:27             ` Sebastian Gniazdowski [this message]
2017-04-28 15:43               ` Peter Stephenson
2017-04-28 16:11                 ` Sebastian Gniazdowski
2017-04-29  6:39             ` Sebastian Gniazdowski
2017-05-01  2:53               ` Jun T.
2017-05-01 15:52                 ` Jun T.
2017-05-02 13:15                   ` Peter Stephenson
2017-05-06 15:58                   ` Sebastian Gniazdowski
2017-05-06 18:11                     ` Bart Schaefer
2017-05-07  9:50                       ` Sebastian Gniazdowski
2017-05-08  2:44                         ` Daniel Shahaf
2017-05-08  4:04                           ` Gmail patch extraction (was: Cannot paste unicode <0221>, <0234> - <024f>) Sebastian Gniazdowski
2017-05-08  4:33                             ` Sebastian Gniazdowski
2017-05-08 11:07                               ` Daniel Shahaf
2017-05-06 18:39                     ` Cannot paste unicode <0221>, <0234> - <024f> Daniel Shahaf
2017-05-07 10:13                   ` Sebastian Gniazdowski
2017-05-10 11:29                   ` Jun T.
2017-05-12  7:50                     ` Sebastian Gniazdowski

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=etPan.59035f54.109cf92e.15fbc@MacMini.local \
    --to=psprint@zdharma.org \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@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).