From: SUNG TAE KIM <itaemu@gmail.com>
To: 64420@debbugs.gnu.org
Subject: bug#64420: string-width of … is 2 in CJK environments
Date: Fri, 14 Jul 2023 13:45:58 +0900 [thread overview]
Message-ID: <CAHTtwczAOj=PkDC7pX0oGzrKjOyJC=gs4omFcKGKXkVHrt_TqQ@mail.gmail.com> (raw)
In-Reply-To: <961e5083-ccf3-9d39-175d-5c5957130d50@gutov.dev>
[-- Attachment #1: Type: text/plain, Size: 2579 bytes --]
Hi, I'm the issue(https://github.com/company-mode/company-mode/issues/1388)
reporter of emacs company package. I've been suggested to comment by the
project owner of the company package on the matter of
character-width-table. So, here's my thoughts.
There's many characters marked as A(ambiguous) width in the file (
https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt) which is
one of the Unicode 15.0.0 Character Database. The characters inside the
general punctuation block (U+2000..U+206F) are marked as either N(Narrow)
or A(Ambiguous) width and the ellipsis character(U+2026) is marked as A.
Also there's a suggestion for rendering the ambiguous width unicode
character for Non-East Asian character in the Unicode 15.0.0 East Asian
Width Technical Report(http://www.unicode.org/reports/tr11/).
Quotes from the TR.
> 5 Recommendations
>
> When processing or displaying data
>
> • Ambiguous characters behave like wide or narrow characters depending
on the context (language tag, script identification, associated font,
source of data, or explicit markup; all can provide the context). If the
context cannot be established reliably, they should be treated as narrow
characters by default.
My understanding of the report about the treatment of the ambiguous width
is that the context is paramount and the recommendation of the default is
narrow for the non-East Asian characters.
How about in practice? I've tested the rendering of a few ambiguous width
characters on some OSes - terminal.
macOS Mojave - builtin, kitty, iterm2
Rendered as narrow character regardless of locale/font setting.
Windows 11 - old and new terminal
Rendered as narrow character regardless of locale/font setting.
Ubuntu 20 - gnome-terminal
User can set the width of ambiguous characters either narrow(default) or
wide through compatibility option.
I'm surprised gnome-terminal has this option. However, it seems incomplete
because when I try to delete an ambiguous width character rendered as a
wide one, the terminal masses up its cursor position whereas deleting a
wide character works fine.
So, I think the proper default width value of the ambiguous width
characters is narrow and there must be options for setting width for those
ambiguous width characters, but such change of default value might cause
breakage in the emacs packages which rely on the CJK language environment.
All in all, I think providing comprehensive options to change the width of
those ambiguous width characters will be desirable.
[-- Attachment #2: Type: text/html, Size: 2891 bytes --]
next prev parent reply other threads:[~2023-07-14 4:45 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-02 12:57 bug#64420: string-width of … is 2 in CJK environments Dmitry Gutov
2023-07-02 13:10 ` Eli Zaretskii
2023-07-02 13:20 ` Dmitry Gutov
2023-07-02 13:43 ` Eli Zaretskii
2023-07-07 2:13 ` Dmitry Gutov
2023-07-07 6:29 ` Eli Zaretskii
2023-07-11 2:13 ` Dmitry Gutov
2023-07-11 11:41 ` Eli Zaretskii
2023-07-11 2:23 ` Dmitry Gutov
2023-07-11 11:48 ` Eli Zaretskii
2023-07-11 18:13 ` Dmitry Gutov
2023-07-11 18:45 ` Eli Zaretskii
2023-07-12 1:17 ` Dmitry Gutov
2023-07-12 19:54 ` Dmitry Gutov
2023-07-12 21:11 ` Yuan Fu
2023-07-13 5:23 ` Eli Zaretskii
2023-07-27 1:52 ` Dmitry Gutov
2023-07-14 4:45 ` SUNG TAE KIM [this message]
2023-07-14 6:58 ` Eli Zaretskii
2023-07-16 11:51 ` Eli Zaretskii
2023-07-14 9:21 ` SUNG TAE KIM
2023-07-14 11:04 ` Eli Zaretskii
2023-07-14 20:11 ` Yuan Fu
2023-07-16 16:59 ` SUNG TAE KIM
2023-07-16 17:15 ` Eli Zaretskii
2023-08-05 15:01 ` Eli Zaretskii
2023-08-10 21:58 ` Yuan Fu
2023-08-11 5:53 ` Eli Zaretskii
2023-08-11 18:07 ` Yuan Fu
2023-08-11 18:36 ` Eli Zaretskii
2023-08-12 20:18 ` Yuan Fu
2023-08-11 22:34 ` Dmitry Gutov
2023-08-13 0:22 ` Dmitry Gutov
2023-08-13 5:24 ` Eli Zaretskii
2023-08-13 10:48 ` Dmitry Gutov
2023-08-13 12:01 ` Eli Zaretskii
2023-08-13 12:53 ` Dmitry Gutov
2023-08-11 23:52 ` Dmitry Gutov
2023-08-12 5:50 ` Eli Zaretskii
2023-08-12 16:40 ` Dmitry Gutov
2023-08-12 17:09 ` Eli Zaretskii
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='CAHTtwczAOj=PkDC7pX0oGzrKjOyJC=gs4omFcKGKXkVHrt_TqQ@mail.gmail.com' \
--to=itaemu@gmail.com \
--cc=64420@debbugs.gnu.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.