GNU bug report logs -
#63029
[BUG?] format inconsistency in deciding string widths on different locales
Previous Next
Reported by: Ruijie Yu <ruijie <at> netyu.xyz>
Date: Sun, 23 Apr 2023 10:39:02 UTC
Severity: normal
Done: Ruijie Yu <ruijie <at> netyu.xyz>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
>> If this is expected behavior, how do we know how "wide" the `format'
>> function thinks any given character is? In other words, why _does_ it
>> think "…" should be two-character wide?
>
> This is a kludgey feature: in CJK locales some characters are always
> considered double-width. See code in characters.el that begins with a
> comment around line 1140. The function use-cjk-char-width-table
> defined there is invoked (via the setup-function of the language
> environment) when the language environment in Emacs is set to one of
> those CJK locales.
>
> The reason for this is that in CJK fonts these characters are supposed
> to be rendered using full-width glyphs.
>
> See also bug#54138 and
> https://lists.gnu.org/archive/html/emacs-devel/2022-02/msg00917.html.
Thanks for the link. I have found the answer in your response there.
>> And how do we, the elisp users, get this information?
>
> I don't understand this question. Please elaborate: what information
> do you want to get, besides the width of the characters (which is
> accessible via char-width-table).
You mentioning `char-width-table' here and `char-width' on the linked
thread precisely answered my question. I was looking for `char-width'
without knowing its name. Thanks.
--
Best,
RY
[Please note that this mail might go to spam due to some
misconfiguration in my mail server -- still investigating.]
This bug report was last modified 2 years and 88 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.