[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: column numbers for non-ASCII characters in error messages
From: |
Ben Pfaff |
Subject: |
Re: column numbers for non-ASCII characters in error messages |
Date: |
Sat, 18 Dec 2010 16:25:54 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> For this reason, the second definition is the one that is normally
> agreed upon. Note, however, that it is ambiguous: For "ambiguous width"
> Unicode characters, the width may depend on the terminal emulator or
> on the locale. But this is not a big problem in practice, because such
> characters occur rarely.
>
> This notion of width, measured by screen columns, is implemented by
> - the POSIX function wcwidth(),
> - the gnulib function mbswidth() (applicable to multibyte strings),
> - the gnulib or libunistring function u8_strwidth() (applicable to UTF-8
> strings).
Bruno and John, thanks for the additional comments. It seems
clear that display width is the correct metric here.
I'm going to use a wrapper around uc_width() from libunistring
that is similar to u8_width() but handles tabs.
--
Ben Pfaff
http://benpfaff.org