GNU bug report logs - #31588
26.1; format counts some Unicode characters as two

Previous Next

Package: emacs;

Reported by: "James P. Ascher" <jpa4q <at> virginia.edu>

Date: Fri, 25 May 2018 00:38:02 UTC

Severity: minor

Tags: notabug

Found in version 26.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 31588 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: "James P. Ascher" <jpa4q <at> virginia.edu>
Cc: 31588 <at> debbugs.gnu.org
Subject: Re: bug#31588: 26.1; format counts some Unicode characters as two
Date: Thu, 24 May 2018 20:50:45 -0400
[Message part 1 (text/plain, inline)]
"James P. Ascher" <jpa4q <at> virginia.edu> writes:

> 3: M-S-: and call (insert (format "%-2s" '➖))
>
> What I expected:
>
> xxxxx➖ xxxxxxxx
>
> What results:
>
> xxxxxx➖xxxxxxx
>
>
> In comparison, (insert (format "%-2s" 'z)) gives:
>
> xxxxxxz xxxxxx

> The same problem occurs on my setup with ❌ (CROSS MARK).
>
> However, these Unicode items characters work as I expect: ▶ (BLACK
> RIGHT-POINTING TRIANGLE), ✚ (HEAVY GREEK CROSS), ▷ (WHITE RIGHT-POINTING
> TRIANGLE), and ◼ (BLACK MEDIUM SQUARE).
>
> As far as I can tell, something is off about the styled_format and how
> it counts characters- I suspect something about counting
> multibyte characters, but it's a little beyond me.

I think it's intended, ➖ and ❌ are wide characters:

    (mapcar #'char-width '(?➖ ?❌ ?▶ ?✚ ?▷ ?◼))
    ;=> (2 2 1 1 1 1)

Although in my current font the width seems to be more like 1.8 or
something.

[wide-chars.png (image/png, attachment)]

This bug report was last modified 7 years and 49 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.